Skip to content

Commit

Permalink
Correctly unconfigure pytask. (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasraabe authored Nov 8, 2023
1 parent 307db03 commit 6d2c07f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions docs/source/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion src/_pytask/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ def build( # noqa: C901, PLR0912, PLR0913
session.exit_code = ExitCode.FAILED

session.hook.pytask_unconfigure(session=session)

return session


Expand Down
1 change: 1 addition & 0 deletions src/_pytask/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
1 change: 1 addition & 0 deletions src/_pytask/collect_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 2 additions & 0 deletions src/_pytask/dag_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/_pytask/mark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def markers(**raw_config: Any) -> NoReturn:

console.print(table)

session.hook.pytask_unconfigure(session=session)
sys.exit(session.exit_code)


Expand Down
1 change: 1 addition & 0 deletions src/_pytask/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 6d2c07f

Please sign in to comment.