diff --git a/docs/source/changes.md b/docs/source/changes.md index fc9fe890..95280220 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -22,6 +22,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and - {pull}`569` removes the hooks related to the creation of the DAG. - {pull}`571` removes redundant calls to `PNode.state()` which causes a high penalty for remote files. +- {pull}`573` removes the `pytask_execute_create_scheduler` hook. ## 0.4.5 - 2024-01-09 diff --git a/docs/source/reference_guides/hookspecs.md b/docs/source/reference_guides/hookspecs.md index 64c01031..0b0b6414 100644 --- a/docs/source/reference_guides/hookspecs.md +++ b/docs/source/reference_guides/hookspecs.md @@ -69,7 +69,6 @@ The following hooks execute the tasks and log information on the result in the t ```{eval-rst} .. autofunction:: pytask_execute .. autofunction:: pytask_execute_log_start -.. autofunction:: pytask_execute_create_scheduler .. autofunction:: pytask_execute_build .. autofunction:: pytask_execute_task_protocol .. autofunction:: pytask_execute_task_log_start diff --git a/src/_pytask/execute.py b/src/_pytask/execute.py index 23329a10..310889fb 100644 --- a/src/_pytask/execute.py +++ b/src/_pytask/execute.py @@ -57,7 +57,7 @@ def pytask_post_parse(config: dict[str, Any]) -> None: def pytask_execute(session: Session) -> None: """Execute tasks.""" session.hook.pytask_execute_log_start(session=session) - session.scheduler = session.hook.pytask_execute_create_scheduler(session=session) + session.scheduler = TopologicalSorter.from_dag(session.dag) session.hook.pytask_execute_build(session=session) session.hook.pytask_execute_log_end( session=session, reports=session.execution_reports @@ -73,12 +73,6 @@ def pytask_execute_log_start(session: Session) -> None: console.print() -@hookimpl(trylast=True) -def pytask_execute_create_scheduler(session: Session) -> TopologicalSorter: - """Create a scheduler based on topological sorting.""" - return TopologicalSorter.from_dag(session.dag) - - @hookimpl def pytask_execute_build(session: Session) -> bool | None: """Execute tasks.""" diff --git a/src/_pytask/hookspecs.py b/src/_pytask/hookspecs.py index 0a66da3e..347af6d6 100644 --- a/src/_pytask/hookspecs.py +++ b/src/_pytask/hookspecs.py @@ -232,16 +232,6 @@ def pytask_execute_log_start(session: Session) -> None: """ -@hookspec(firstresult=True) -def pytask_execute_create_scheduler(session: Session) -> Any: - """Create a scheduler for the execution. - - The scheduler provides information on which tasks are able to be executed. Its - foundation is likely a topological ordering of the tasks based on the DAG. - - """ - - @hookspec(firstresult=True) def pytask_execute_build(session: Session) -> Any: """Execute the build.