Skip to content

Commit 9479410

Browse files
authored
Merge branch 'main' into uv
2 parents bf915fa + d0f6542 commit 9479410

24 files changed

+102
-161
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ concurrency:
55
group: ${{ github.head_ref || github.run_id }}
66
cancel-in-progress: true
77

8-
env:
9-
CONDA_EXE: mamba
10-
118
on:
129
push:
1310
branches:

.github/workflows/update-plugin-list.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: python scripts/update_plugin_list.py
3838

3939
- name: Create Pull Request
40-
uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50
40+
uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc
4141
with:
4242
commit-message: '[automated] Update plugin list'
4343
author: 'Tobias Raabe <[email protected]>'

.pre-commit-config.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ repos:
3333
hooks:
3434
- id: sort-all
3535
- repo: https://github.com/astral-sh/ruff-pre-commit
36-
rev: v0.3.1
36+
rev: v0.3.2
3737
hooks:
3838
- id: ruff-format
3939
- id: ruff
4040
args: [--unsafe-fixes]
4141
- repo: https://github.com/dosisod/refurb
42-
rev: v1.28.0
42+
rev: v2.0.0
4343
hooks:
4444
- id: refurb
4545
args: [--ignore, FURB126]
4646
- repo: https://github.com/pre-commit/mirrors-mypy
47-
rev: v1.8.0
47+
rev: v1.9.0
4848
hooks:
4949
- id: mypy
5050
additional_dependencies: [
@@ -80,8 +80,6 @@ repos:
8080
- repo: https://github.com/nbQA-dev/nbQA
8181
rev: 1.8.4
8282
hooks:
83-
- id: nbqa-black
84-
- id: nbqa-isort
8583
- id: nbqa-mypy
8684
args: [--ignore-missing-imports]
8785
- repo: https://github.com/kynan/nbstripout

docs/source/changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
1919
- {pull}`557` fixes an issue with `@task(after=...)` in notebooks and terminals.
2020
- {pull}`566` makes universal-pathlib an official dependency.
2121
- {pull}`567` adds uv to the CI workflow for faster installation.
22+
- {pull}`568` restricts `task_files` to a list of patterns and raises a better error.
23+
- {pull}`569` removes the hooks related to the creation of the DAG.
24+
- {pull}`571` removes redundant calls to `PNode.state()` which causes a high penalty for
25+
remote files.
26+
- {pull}`573` removes the `pytask_execute_create_scheduler` hook.
2227

2328
## 0.4.5 - 2024-01-09
2429

docs/source/reference_guides/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ strict_markers = true
242242
Change the pattern which identify task files.
243243
244244
```toml
245-
task_files = "task_*.py" # default
245+
task_files = ["task_*.py"] # default
246246
247247
task_files = ["task_*.py", "tasks_*.py"]
248248
```

docs/source/reference_guides/hookspecs.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,33 +62,13 @@ The following hooks traverse directories and collect tasks from files.
6262
.. autofunction:: pytask_collect_log
6363
```
6464

65-
## Resolving Dependencies
66-
67-
The following hooks are designed to build a DAG from tasks and dependencies and check
68-
which files have changed and need to be re-run.
69-
70-
```{warning}
71-
This step is still experimental and likely to change in the future. If you are planning
72-
to write a plugin which extends pytask in this dimension, please, start a discussion
73-
before writing a plugin. It may make your life easier if changes in pytask anticipate
74-
your plugin.
75-
```
76-
77-
```{eval-rst}
78-
.. autofunction:: pytask_dag
79-
.. autofunction:: pytask_dag_create_dag
80-
.. autofunction:: pytask_dag_log
81-
82-
```
83-
8465
## Execution
8566

8667
The following hooks execute the tasks and log information on the result in the terminal.
8768

8869
```{eval-rst}
8970
.. autofunction:: pytask_execute
9071
.. autofunction:: pytask_execute_log_start
91-
.. autofunction:: pytask_execute_create_scheduler
9272
.. autofunction:: pytask_execute_build
9373
.. autofunction:: pytask_execute_task_protocol
9474
.. autofunction:: pytask_execute_task_log_start

docs/source/tutorials/defining_dependencies_products.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ task has finished, pytask will check whether the file exists.
7272
7373
````
7474
75-
````{tab-item} prodouces
75+
````{tab-item} produces
7676
:sync: produces
7777
7878
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_products_produces.py
@@ -132,7 +132,7 @@ annotation are dependencies of the task.
132132
133133
````
134134
135-
````{tab-item} prodouces
135+
````{tab-item} produces
136136
:sync: produces
137137
138138
To specify that the task relies on the data set `data.pkl`, you can add the path to the
@@ -178,7 +178,7 @@ are assumed to point to a location relative to the task module.
178178
179179
````
180180
181-
````{tab-item} prodouces
181+
````{tab-item} produces
182182
:sync: produces
183183
184184
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_relative_produces.py

src/_pytask/_hashlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,5 @@ def hash_value(value: Any) -> int | str:
232232
if isinstance(value, str):
233233
value = value.encode()
234234
if isinstance(value, bytes):
235-
return str(hashlib.sha256(value).hexdigest())
235+
return hashlib.sha256(value).hexdigest()
236236
return hash(value)

src/_pytask/build.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from _pytask.config_utils import find_project_root_and_config
2222
from _pytask.config_utils import read_config
2323
from _pytask.console import console
24+
from _pytask.dag import create_dag
2425
from _pytask.exceptions import CollectionError
2526
from _pytask.exceptions import ConfigurationError
2627
from _pytask.exceptions import ExecutionError
@@ -95,7 +96,7 @@ def build( # noqa: C901, PLR0912, PLR0913, PLR0915
9596
stop_after_first_failure: bool = False,
9697
strict_markers: bool = False,
9798
tasks: Callable[..., Any] | PTask | Iterable[Callable[..., Any] | PTask] = (),
98-
task_files: str | Iterable[str] = "task_*.py",
99+
task_files: Iterable[str] = ("task_*.py",),
99100
trace: bool = False,
100101
verbose: int = 1,
101102
**kwargs: Any,
@@ -265,7 +266,7 @@ def build( # noqa: C901, PLR0912, PLR0913, PLR0915
265266
try:
266267
session.hook.pytask_log_session_header(session=session)
267268
session.hook.pytask_collect(session=session)
268-
session.hook.pytask_dag(session=session)
269+
session.dag = create_dag(session=session)
269270
session.hook.pytask_execute(session=session)
270271

271272
except CollectionError:

src/_pytask/collect_command.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from _pytask.console import create_url_style_for_path
2020
from _pytask.console import format_node_name
2121
from _pytask.console import format_task_name
22+
from _pytask.dag import create_dag
2223
from _pytask.exceptions import CollectionError
2324
from _pytask.exceptions import ConfigurationError
2425
from _pytask.exceptions import ResolvingDependenciesError
@@ -70,7 +71,7 @@ def collect(**raw_config: Any | None) -> NoReturn:
7071
try:
7172
session.hook.pytask_log_session_header(session=session)
7273
session.hook.pytask_collect(session=session)
73-
session.hook.pytask_dag(session=session)
74+
session.dag = create_dag(session=session)
7475

7576
tasks = _select_tasks_by_expressions_and_marker(session)
7677
task_with_path = [t for t in tasks if isinstance(t, PTaskWithPath)]

0 commit comments

Comments
 (0)