diff --git a/docs/source/changes.md b/docs/source/changes.md index da1c05b7..bcfd3d7d 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -5,7 +5,13 @@ chronological order. Releases follow [semantic versioning](https://semver.org/) releases are available on [PyPI](https://pypi.org/project/pytask) and [Anaconda.org](https://anaconda.org/conda-forge/pytask). -## 0.4.2 - 2023-xx-xx +## 0.4.3 - 2023-11-xx + +- {pull}`483` simplifies the teardown of a task. +- {pull}`485` adds missing steps to unconfigure pytask after the job is done which + caused flaky tests. + +## 0.4.2 - 2023-11-8 - {pull}`449` simplifies the code building the plugin manager. - {pull}`451` improves `collect_command.py` and renames `graph.py` to `dag_command.py`. @@ -30,7 +36,6 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and It is delegated to the check during the execution. - {pull}`481` improves coverage. - {pull}`482` correctly handles names and signatures of {class}`~pytask.PythonNode`. -- {pull}`483` simplifies the teardown of a task. ## 0.4.1 - 2023-10-11 diff --git a/src/_pytask/build.py b/src/_pytask/build.py index 1234bc33..3152bc88 100644 --- a/src/_pytask/build.py +++ b/src/_pytask/build.py @@ -278,7 +278,6 @@ def build( # noqa: C901, PLR0912, PLR0913 session.exit_code = ExitCode.FAILED session.hook.pytask_unconfigure(session=session) - return session diff --git a/src/_pytask/clean.py b/src/_pytask/clean.py index 3aaa2884..15ea6add 100644 --- a/src/_pytask/clean.py +++ b/src/_pytask/clean.py @@ -165,6 +165,7 @@ def clean(**raw_config: Any) -> NoReturn: # noqa: C901, PLR0912 console.rule(style="failed") session.exit_code = ExitCode.FAILED + session.hook.pytask_unconfigure(session=session) sys.exit(session.exit_code) diff --git a/src/_pytask/collect_command.py b/src/_pytask/collect_command.py index 064d85fd..31c6b8a5 100644 --- a/src/_pytask/collect_command.py +++ b/src/_pytask/collect_command.py @@ -101,6 +101,7 @@ def collect(**raw_config: Any | None) -> NoReturn: console.print_exception() console.rule(style="failed") + session.hook.pytask_unconfigure(session=session) sys.exit(session.exit_code) diff --git a/src/_pytask/dag_command.py b/src/_pytask/dag_command.py index d9034791..5eeef7da 100644 --- a/src/_pytask/dag_command.py +++ b/src/_pytask/dag_command.py @@ -115,6 +115,7 @@ def dag(**raw_config: Any) -> int: console.print(Traceback.from_exception(*exc_info)) console.rule(style="failed") + session.hook.pytask_unconfigure(session=session) sys.exit(session.exit_code) @@ -198,6 +199,7 @@ def build_dag(raw_config: dict[str, Any]) -> nx.DiGraph: ) session.hook.pytask_collect(session=session) session.hook.pytask_dag(session=session) + session.hook.pytask_unconfigure(session=session) dag = _refine_dag(session) except Exception: diff --git a/src/_pytask/mark/__init__.py b/src/_pytask/mark/__init__.py index 97ac4ed6..f99d1b74 100644 --- a/src/_pytask/mark/__init__.py +++ b/src/_pytask/mark/__init__.py @@ -66,6 +66,7 @@ def markers(**raw_config: Any) -> NoReturn: console.print(table) + session.hook.pytask_unconfigure(session=session) sys.exit(session.exit_code) diff --git a/src/_pytask/profile.py b/src/_pytask/profile.py index 794e4906..4c873f5d 100644 --- a/src/_pytask/profile.py +++ b/src/_pytask/profile.py @@ -150,6 +150,7 @@ def profile(**raw_config: Any) -> NoReturn: console.print_exception() console.rule(style="failed") + session.hook.pytask_unconfigure(session=session) sys.exit(session.exit_code)