Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v5
Expand All @@ -63,7 +63,7 @@ jobs:
uses: codecov/codecov-action@v5

- name: Run tests with lowest resolution
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
run: just test-lowest

- name: Run tests with highest resolution
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
- {pull}`703` fixes {issue}`701` by allowing `--capture tee-sys` again.
- {pull}`704` adds the `--explain` flag to show why tasks would be executed. Closes {issue}`466`.
- {pull}`706` disables syntax highlighting for platform version information in session header.
- {pull}`707` drops support for Python 3.9 as it has reached end of life.

## 0.5.5 - 2025-07-25

Expand Down
4 changes: 2 additions & 2 deletions docs/source/_static/md/pdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0
Root: C:\Users\pytask-dev\git\my_project
Collected 1 task.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<span style="color: #f14c4c">╭───────────────────</span><span style="color: #f14c4c; font-weight: bold;"> Traceback </span><span style="color: #6c1e1e; font-weight: bold">(most recent call last)</span><span style="color: #f14c4c"> ─────────────────╮</span>
<span style="color: #f14c4c">│</span> <span style="color: #f14c4c">│</span>
<span style="color: #f14c4c">│</span> <span style="color: #e5e510">.../task_data_preparation.py</span>:<span style="color: var(--termynal-blue)">23</span> in <span style="color: #23d18b">task_create_random_data</span> <span style="color: #f14c4c">│</span>
Expand All @@ -24,7 +24,7 @@ Collected 1 task.
<span style="color: #f14c4c; font-weight: bold;">Exception</span>

>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>
> ...\git\my_project\task_data_preparation.py(23)task_create_random_data()
> ...\my_project\task_data_preparation.py(23)task_create_random_data()
-> raise Exception
<span data-ty="input" data-ty-prompt="(Pdb)" data-ty-cursor="▋"></span>

Expand Down
68 changes: 34 additions & 34 deletions docs/source/_static/md/show-locals.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/source/_static/md/trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
```console

$ pytask --trace
──────────────────────────── Start pytask session ────────────────────────────
────────────────────────── Start pytask session ─────────────────────────
Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0
Root: C:\Users\pytask-dev\git\my_project
Collected 1 task.

>>>>>>>>>>>>>>>>>> PDB runcall (IO-capturing turned off) >>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> PDB runcall (IO-capturing turned off) >>>>>>>>>>>>>>>>

> ...\git\my_project\task_create_random_data.py(13)task_create_random_data()
> ...\my_project\task_create_random_data.py(13)task_create_random_data()
-> rng = np.random.default_rng(0)
<span data-ty="input" data-ty-prompt="(Pdb)" data-ty-cursor="▋"></span>

Expand Down
10 changes: 1 addition & 9 deletions docs/source/how_to_guides/capture_warnings.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,5 @@ and then run `pytask`.
Or, you use a temporary environment variable. Here is an example for bash.

```console
PYTHONWARNINGS=error pytask --pdb
```

and here for Powershell

```console
$env:PYTHONWARNINGS = 'error'
pytask
Remove-Item env:\PYTHONWARNINGS
$ PYTHONWARNINGS=error pytask --pdb
```
21 changes: 0 additions & 21 deletions docs/source/how_to_guides/hashing_inputs_of_tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,19 @@ If an input is not parsed by any more specific node type, the general
In the following example, the argument `text` will be parsed as a
{class}`~pytask.PythonNode`.

`````{tab-set}

````{tab-item} Python 3.10+

```{literalinclude} ../../../docs_src/how_to_guides/hashing_inputs_of_tasks_example_1_py310.py
```

````
`````

By default, pytask does not detect changes in {class}`~pytask.PythonNode` and if the
value would change (without changing the task module), pytask would not rerun the task.

We can also hash the value of {class}`~pytask.PythonNode` s so that pytask knows when
the input changed. For that, we need to use the {class}`~pytask.PythonNode` explicitly
and set `hash = True`.

`````{tab-set}

````{tab-item} Python 3.10+

```{literalinclude} ../../../docs_src/how_to_guides/hashing_inputs_of_tasks_example_2_py310.py
```

````
`````

When `hash=True`, pytask will call the builtin {func}`hash` on the input that will call
the `__hash__()` method of the object.

Expand Down Expand Up @@ -75,12 +61,5 @@ $ conda install deepdiff
Then, create the hash function and pass it to the node. Make sure it returns either an
integer or a string.

`````{tab-set}

````{tab-item} Python 3.10+

```{literalinclude} ../../../docs_src/how_to_guides/hashing_inputs_of_tasks_example_3_py310.py
```

````
`````
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ as the task module because it is a relative path.

```{literalinclude} ../../../docs_src/how_to_guides/provisional_products.py
---
emphasize-lines: 4, 22
emphasize-lines: 6, 23
---
```

Expand Down Expand Up @@ -57,7 +57,7 @@ downloaded.

```{literalinclude} ../../../docs_src/how_to_guides/provisional_task.py
---
emphasize-lines: 9
emphasize-lines: 4, 9
---
```

Expand Down Expand Up @@ -86,6 +86,9 @@ The code snippet shows each task takes one of the downloaded files and copies it
content to a `.txt` file.

```{literalinclude} ../../../docs_src/how_to_guides/provisional_task_generator.py
---
emphasize-lines: 4, 11
---
```

```{important}
Expand Down
35 changes: 6 additions & 29 deletions docs/source/how_to_guides/using_task_returns.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,14 @@ defines where the return of the function, a string, should be stored.

`````{tab-set}

````{tab-item} Python 3.10+
:sync: python310plus
````{tab-item} Annotated
:sync: annotated

```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_1_py310.py
```

````

````{tab-item} Python 3.9
:sync: python38plus

```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_1_py38.py
```

````
`````

It works because internally the path is converted to a {class}`pytask.PathNode` that is
Expand Down Expand Up @@ -60,22 +53,14 @@ of the previous interfaces.

`````{tab-set}

````{tab-item} Python 3.10+
:sync: python310plus
````{tab-item} Annotated
:sync: annotated

```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_3_py310.py
```

````

````{tab-item} Python 3.9
:sync: python38plus

```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_3_py38.py
```

````

````{tab-item} @pytask.task

```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_3_task.py
Expand All @@ -95,22 +80,14 @@ mapped to the defined nodes.

`````{tab-set}

````{tab-item} Python 3.10+
:sync: python310plus
````{tab-item} Annotated
:sync: annotated

```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_4_py310.py
```

````

````{tab-item} Python 3.9
:sync: python38plus

```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_4_py38.py
```

````

````{tab-item} @pytask.task

```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_4_task.py
Expand Down
34 changes: 6 additions & 28 deletions docs/source/how_to_guides/writing_custom_nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,22 @@ The result will be the following task.

`````{tab-set}

````{tab-item} Python 3.10+
:sync: python310plus
````{tab-item} Annotated
:sync: annotated

```{literalinclude} ../../../docs_src/how_to_guides/writing_custom_nodes_example_2_py310.py
```

````

````{tab-item} Python 3.10+ & Return
:sync: python310plus
````{tab-item} Annotated & Return
:sync: annotated

```{literalinclude} ../../../docs_src/how_to_guides/writing_custom_nodes_example_2_py310_return.py
```

````

````{tab-item} Python 3.9
:sync: python38plus

```{literalinclude} ../../../docs_src/how_to_guides/writing_custom_nodes_example_2_py38.py
```

````

````{tab-item} Python 3.9 & Return
:sync: python38plus

```{literalinclude} ../../../docs_src/how_to_guides/writing_custom_nodes_example_2_py38_return.py
```

````
`````

## Nodes
Expand All @@ -79,21 +64,14 @@ we arrive at the following class.

`````{tab-set}

````{tab-item} Python 3.10+
:sync: python310plus
````{tab-item} Annotated
:sync: annotated

```{literalinclude} ../../../docs_src/how_to_guides/writing_custom_nodes_example_3_py310.py
```

````

````{tab-item} Python 3.9
:sync: python38plus

```{literalinclude} ../../../docs_src/how_to_guides/writing_custom_nodes_example_3_py38.py
```

````
`````

Here are some explanations.
Expand Down
Loading