Skip to content

Commit d2d2f1e

Browse files
committed
Merge origin/main into lockfile
2 parents f13b85d + 8b69384 commit d2d2f1e

47 files changed

Lines changed: 344 additions & 244 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ repos:
2525
- id: python-no-log-warn
2626
- id: text-unicode-replacement-char
2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.14.14
28+
rev: v0.15.1
2929
hooks:
3030
- id: ruff-format
3131
- id: ruff-check
3232
- repo: https://github.com/astral-sh/uv-pre-commit
33-
rev: 0.9.26
33+
rev: 0.10.3
3434
hooks:
3535
- id: uv-lock
3636
- repo: https://github.com/executablebooks/mdformat

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,18 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
1010
- {issue}`735` adds the `pytask.lock` lockfile as the primary state backend with a
1111
portable format, documentation, and a one-run SQLite fallback when no lockfile
1212
exists.
13+
- {pull}`787` makes the `attributes` field mandatory on `PNode` and
14+
`PProvisionalNode`, and preserves existing node attributes when loading entries from
15+
the data catalog.
16+
- {pull}`744` Removed the direct dependency on attrs and migrated internal models to
17+
dataclasses.
1318
- {pull}`766` moves runtime profiling persistence from SQLite to a JSON snapshot plus
1419
append-only journal in `.pytask/`, keeping runtime data resilient to crashes and
1520
compacted on normal build exits.
21+
- {pull}`776` clears decoration-time `annotation_locals` snapshots after collection so
22+
task functions remain picklable in process-based parallel backends.
23+
- {pull}`788` updates debugger interaction tests to support Python-version-specific
24+
`pdb` stepping behavior and avoid frame-specific assumptions on repeated breakpoints.
1625

1726
## 0.5.8 - 2025-12-30
1827

docs/source/explanations/comparison_to_other_tools.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ pipefunc is a lightweight library for creating function pipelines as directed ac
9595
graphs (DAGs) in pure Python. It automatically handles execution order, supports
9696
map-reduce operations, parallel execution, and provides resource profiling.
9797

98+
## [Hamilton](https://github.com/dagworks-inc/hamilton)
99+
100+
Hamilton is a Python framework for building dataflows as function graphs, with a focus
101+
on modular transformations, lineage, and observability for data and ML pipelines.
102+
98103
## [Common Workflow Language (CWL)](https://www.commonwl.org/)
99104

100105
CWL is an open standard for describing data analysis workflows in a portable,

docs/source/how_to_guides/writing_custom_nodes.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,13 @@ databases. [^kedro]
127127

128128
## References
129129

130-
[^structural-subtyping]: Structural subtyping is similar to ABCs an approach in Python to enforce interfaces,
131-
but it can be considered more pythonic since it is closer to duck typing. Hynek
132-
Schlawack wrote a comprehensive
133-
[guide on subclassing](https://hynek.me/articles/python-subclassing-redux/) that
134-
features protocols under "Type 2". Glyph wrote an introduction to protocols called
130+
[^structural-subtyping]: Structural subtyping is similar to ABCs an approach in Python
131+
to enforce interfaces, but it can be considered more pythonic
132+
since it is closer to duck typing. Hynek Schlawack wrote a
133+
comprehensive
134+
[guide on subclassing](https://hynek.me/articles/python-subclassing-redux/)
135+
that features protocols under "Type 2". Glyph wrote an
136+
introduction to protocols called
135137
[I want a new duck](https://glyph.twistedmatrix.com/2020/07/new-duck.html).
136138

137139
[^kedro]: Kedro, another workflow system, provides many adapters to data sources:

docs/source/plugin_list.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This list contains 7 plugins.
2525
:pypi:`pytask-environment` Detect changes in your pytask environment and abort a project build. Feb 10, 2023 4 - Beta pytask (>=0.2)
2626
:pypi:`pytask-julia` A Pytask plugin for Julia Oct 07, 2023 4 - Beta pytask >=0.4.0
2727
:pypi:`pytask-latex` Compile LaTeX documents with pytask. Jun 01, 2025 4 - Beta pytask>=0.4.0
28-
:pypi:`pytask-parallel` Parallelize the execution of tasks with pytask. Mar 09, 2025 4 - Beta pytask>=0.5.2
28+
:pypi:`pytask-parallel` Parallelize the execution of tasks with pytask. Feb 06, 2026 4 - Beta pytask>=0.5.2
2929
:pypi:`pytask-r` Run R scripts with pytask. Apr 20, 2024 4 - Beta pytask>=0.4.5
3030
:pypi:`pytask-stata` Execute do-files with Stata and pytask. Jul 26, 2025 4 - Beta pytask>=0.5.2
3131
:pypi:`pytask-vscode` Additional Logging for VS Code integration Nov 21, 2023 3 - Alpha pytask >=0.4.2

docs/source/reference_guides/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ Nodes are the interface for different kinds of dependencies or products.
203203
:members:
204204
.. autoclass:: pytask.PickleNode
205205
:members:
206+
:exclude-members: serializer, deserializer
206207
.. autoclass:: pytask.PythonNode
207208
:members:
208209
.. autoclass:: pytask.DirectoryNode

docs_src/how_to_guides/the_data_catalog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
from dataclasses import dataclass
12
from pathlib import Path
23
from typing import Any
34

45
import cloudpickle
5-
from attrs import define
66

77

8-
@define
8+
@dataclass
99
class PickleNode:
1010
"""A node for pickle files.
1111

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ classifiers = [
2121
]
2222
dynamic = ["version"]
2323
dependencies = [
24-
"attrs>=21.3.0",
2524
"click>=8.1.8,!=8.2.0",
2625
"click-default-group>=1.2.4",
2726
"msgspec>=0.18.6",

src/_pytask/cache.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
import functools
66
import hashlib
77
import inspect
8+
from dataclasses import dataclass
9+
from dataclasses import field
810
from inspect import FullArgSpec
911
from typing import TYPE_CHECKING
1012
from typing import Any
1113
from typing import ParamSpec
1214
from typing import Protocol
1315
from typing import TypeVar
1416

15-
from attrs import define
16-
from attrs import field
17-
1817
from _pytask._hashlib import hash_value
1918

2019
if TYPE_CHECKING:
@@ -35,17 +34,17 @@ class HasCache(Protocol):
3534
cache: Cache
3635

3736

38-
@define
37+
@dataclass
3938
class CacheInfo:
4039
hits: int = 0
4140
misses: int = 0
4241

4342

44-
@define
43+
@dataclass
4544
class Cache:
46-
_cache: dict[str, Any] = field(factory=dict)
47-
_sentinel: Any = field(factory=object)
48-
cache_info: CacheInfo = field(factory=CacheInfo)
45+
_cache: dict[str, Any] = field(default_factory=dict)
46+
_sentinel: Any = field(default_factory=object)
47+
cache_info: CacheInfo = field(default_factory=CacheInfo)
4948

5049
def memoize(self, func: Callable[P, R]) -> Memoized[P, R]:
5150
func_module = getattr(func, "__module__", "")

src/_pytask/clean.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import itertools
77
import shutil
88
import sys
9+
from dataclasses import dataclass
910
from typing import TYPE_CHECKING
1011
from typing import Any
1112

1213
import click
13-
from attrs import define
1414

1515
from _pytask.click import ColoredCommand
1616
from _pytask.click import EnumChoice
@@ -243,7 +243,7 @@ def _find_all_unknown_paths(
243243
)
244244

245245

246-
@define(repr=False)
246+
@dataclass(repr=False)
247247
class _RecursivePathNode:
248248
"""A class for a path to a file or directory which recursively instantiates itself.
249249

0 commit comments

Comments
 (0)