Skip to content

Commit d0f6542

Browse files
authored
Remove pytask_execute_create_scheduler hook. (#575)
1 parent fe0c91c commit d0f6542

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed

docs/source/changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
2222
- {pull}`569` removes the hooks related to the creation of the DAG.
2323
- {pull}`571` removes redundant calls to `PNode.state()` which causes a high penalty for
2424
remote files.
25+
- {pull}`573` removes the `pytask_execute_create_scheduler` hook.
2526

2627
## 0.4.5 - 2024-01-09
2728

docs/source/reference_guides/hookspecs.md

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ The following hooks execute the tasks and log information on the result in the t
6969
```{eval-rst}
7070
.. autofunction:: pytask_execute
7171
.. autofunction:: pytask_execute_log_start
72-
.. autofunction:: pytask_execute_create_scheduler
7372
.. autofunction:: pytask_execute_build
7473
.. autofunction:: pytask_execute_task_protocol
7574
.. autofunction:: pytask_execute_task_log_start

src/_pytask/execute.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def pytask_post_parse(config: dict[str, Any]) -> None:
5757
def pytask_execute(session: Session) -> None:
5858
"""Execute tasks."""
5959
session.hook.pytask_execute_log_start(session=session)
60-
session.scheduler = session.hook.pytask_execute_create_scheduler(session=session)
60+
session.scheduler = TopologicalSorter.from_dag(session.dag)
6161
session.hook.pytask_execute_build(session=session)
6262
session.hook.pytask_execute_log_end(
6363
session=session, reports=session.execution_reports
@@ -73,12 +73,6 @@ def pytask_execute_log_start(session: Session) -> None:
7373
console.print()
7474

7575

76-
@hookimpl(trylast=True)
77-
def pytask_execute_create_scheduler(session: Session) -> TopologicalSorter:
78-
"""Create a scheduler based on topological sorting."""
79-
return TopologicalSorter.from_dag(session.dag)
80-
81-
8276
@hookimpl
8377
def pytask_execute_build(session: Session) -> bool | None:
8478
"""Execute tasks."""

src/_pytask/hookspecs.py

-10
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,6 @@ def pytask_execute_log_start(session: Session) -> None:
232232
"""
233233

234234

235-
@hookspec(firstresult=True)
236-
def pytask_execute_create_scheduler(session: Session) -> Any:
237-
"""Create a scheduler for the execution.
238-
239-
The scheduler provides information on which tasks are able to be executed. Its
240-
foundation is likely a topological ordering of the tasks based on the DAG.
241-
242-
"""
243-
244-
245235
@hookspec(firstresult=True)
246236
def pytask_execute_build(session: Session) -> Any:
247237
"""Execute the build.

0 commit comments

Comments
 (0)