diff --git a/recipe/meta.json b/recipe/meta.json index 38fe47447..09cf57924 100644 --- a/recipe/meta.json +++ b/recipe/meta.json @@ -32,5 +32,5 @@ "pyyaml =6.0.*" ] }, - "version": "2.3.0" + "version": "2.3.1" } diff --git a/src/uwtools/drivers/driver.py b/src/uwtools/drivers/driver.py index eca4cf8a5..5de6330a4 100644 --- a/src/uwtools/drivers/driver.py +++ b/src/uwtools/drivers/driver.py @@ -237,7 +237,7 @@ def _run_via_local_execution(self): A run executed directly on the local system. """ yield self._taskname("run via local execution") - path = self._rundir / f"done.{self._driver_name}" + path = self._rundir / self._runscript_done_file yield asset(path, path.is_file) yield self.provisioned_run_directory() cmd = "{x} >{x}.out 2>&1".format(x=self._runscript_path) @@ -312,6 +312,13 @@ def _runscript( ) return re.sub(r"\n\n\n+", "\n\n", rs.strip()) + @property + def _runscript_done_file(self): + """ + The path to the done file produced by the successful completion of a run script. + """ + return f"{self._runscript_path.name}.done" + @property def _runscript_path(self) -> Path: """ @@ -343,7 +350,7 @@ def _write_runscript(self, path: Path, envvars: Dict[str, str]) -> None: envvars=envvars, execution=[ "time %s" % self._runcmd, - "test $? -eq 0 && touch %s.done" % self._runscript_path.name, + "test $? -eq 0 && touch %s" % self._runscript_done_file, ], scheduler=self._scheduler if self._batch else None, ) diff --git a/src/uwtools/resources/info.json b/src/uwtools/resources/info.json index 674c8cbba..948e92c4d 100644 --- a/src/uwtools/resources/info.json +++ b/src/uwtools/resources/info.json @@ -1,4 +1,4 @@ { - "version": "2.3.0", + "version": "2.3.1", "buildnum": "0" } diff --git a/src/uwtools/tests/drivers/test_driver.py b/src/uwtools/tests/drivers/test_driver.py index 49c2cdd1a..eff8efa59 100644 --- a/src/uwtools/tests/drivers/test_driver.py +++ b/src/uwtools/tests/drivers/test_driver.py @@ -426,6 +426,10 @@ def test_Driver__runscript_execution_only(driverobj): assert driverobj._runscript(execution=["foo", "bar"]) == dedent(expected).strip() +def test_Driver__runscript_done_file(driverobj): + assert driverobj._runscript_done_file == "runscript.concrete.done" + + def test_Driver__runscript_path(driverobj): assert driverobj._runscript_path == Path("/path/to/2024032218/run/runscript.concrete")