Skip to content

Commit 5804f52

Browse files
Support Python 3.13 and drop 3.8. (#633)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f93d40f commit 5804f52

File tree

90 files changed

+4362
-1321
lines changed

Some content is hidden

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

90 files changed

+4362
-1321
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
fail-fast: false
4040
matrix:
4141
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
42-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
42+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
4343

4444
steps:
4545
- uses: actions/checkout@v4

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Python
2727
uses: actions/setup-python@v5
2828
with:
29-
python-version: 3.8
29+
python-version: 3.12
3030

3131
- name: Install dependencies
3232
run: |

.python-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12.3
1+
3.12

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ with `task_`. Here is an example.
8282
from pathlib import Path
8383

8484
from pytask import Product
85-
from typing_extensions import Annotated
85+
from typing import Annotated
8686

8787

8888
def task_hello_earth(path: Annotated[Path, Product] = Path("hello_earth.txt")):

docs/source/changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
77

88
## 0.5.2 - 2024-09-15
99

10+
- {pull}`633` adds support for Python 3.13 and drops support for 3.8.
1011
- {pull}`640` stops the live display when an exception happened during the execution.
1112
- {pull}`646` adds a `.gitignore` to the `.pytask/` folder to exclude it from version
1213
control.

docs/source/how_to_guides/the_data_catalog.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The task could look like this.
110110
```python
111111
from pathlib import Path
112112
from pytask import task
113-
from typing_extensions import Annotated
113+
from typing import Annotated
114114

115115
from my_project.config import DATA_NAMES
116116
from my_project.config import MODEL_NAMES

docs/source/how_to_guides/using_task_returns.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ defines where the return of the function, a string, should be stored.
2626
2727
````
2828
29-
````{tab-item} Python 3.8+
29+
````{tab-item} Python 3.9
3030
:sync: python38plus
3131
3232
```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_1_py38.py
@@ -68,7 +68,7 @@ of the previous interfaces.
6868
6969
````
7070
71-
````{tab-item} Python 3.8+
71+
````{tab-item} Python 3.9
7272
:sync: python38plus
7373
7474
```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_3_py38.py
@@ -103,7 +103,7 @@ mapped to the defined nodes.
103103
104104
````
105105
106-
````{tab-item} Python 3.8+
106+
````{tab-item} Python 3.9
107107
:sync: python38plus
108108
109109
```{literalinclude} ../../../docs_src/how_to_guides/using_task_returns_example_4_py38.py

docs/source/how_to_guides/writing_custom_nodes.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ The result will be the following task.
4242
4343
````
4444
45-
````{tab-item} Python 3.8+
45+
````{tab-item} Python 3.9
4646
:sync: python38plus
4747
4848
```{literalinclude} ../../../docs_src/how_to_guides/writing_custom_nodes_example_2_py38.py
4949
```
5050
5151
````
5252
53-
````{tab-item} Python 3.8+ & Return
53+
````{tab-item} Python 3.9 & Return
5454
:sync: python38plus
5555
5656
```{literalinclude} ../../../docs_src/how_to_guides/writing_custom_nodes_example_2_py38_return.py
@@ -87,7 +87,7 @@ we arrive at the following class.
8787
8888
````
8989
90-
````{tab-item} Python 3.8+
90+
````{tab-item} Python 3.9
9191
:sync: python38plus
9292
9393
```{literalinclude} ../../../docs_src/how_to_guides/writing_custom_nodes_example_3_py38.py

docs/source/reference_guides/api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ resolution and execution.
329329
330330
>>> from pathlib import Path
331331
>>> from pytask import Product
332-
>>> from typing_extensions import Annotated
332+
>>> from typing import Annotated
333333
>>> def task_example(path: Annotated[Path, Product]) -> None:
334334
... path.write_text("Hello, World!")
335335

docs/source/tutorials/defining_dependencies_products.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Defining dependencies and products also serves another purpose. By analyzing the
66
pytask determines the order to run the tasks.
77

88
This tutorial offers you different interfaces. If you are comfortable with type
9-
annotations or are not afraid to try them, look at the `Python 3.10+` or `3.8+` tabs.
10-
You find a tutorial on type hints {doc}`here <../type_hints>`.
9+
annotations or are not afraid to try them, look at the `Python 3.10+` or `3.9` tabs. You
10+
find a tutorial on type hints {doc}`here <../type_hints>`.
1111

1212
If you want to avoid type annotations for now, look at the tab named `produces`.
1313

@@ -60,7 +60,7 @@ task has finished, pytask will check whether the file exists.
6060
6161
````
6262
63-
````{tab-item} Python 3.8+
63+
````{tab-item} Python 3.9
6464
:sync: python38plus
6565
6666
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_products_py38.py
@@ -117,7 +117,7 @@ annotation are dependencies of the task.
117117
118118
````
119119
120-
````{tab-item} Python 3.8+
120+
````{tab-item} Python 3.9
121121
:sync: python38plus
122122
123123
To specify that the task relies on the data set `data.pkl`, you can add the path
@@ -169,7 +169,7 @@ are assumed to point to a location relative to the task module.
169169
170170
````
171171
172-
````{tab-item} Python 3.8+
172+
````{tab-item} Python 3.9
173173
:sync: python38plus
174174
175175
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_relative_py38.py
@@ -209,7 +209,7 @@ structures if needed.
209209
210210
````
211211
212-
````{tab-item} Python 3.8+
212+
````{tab-item} Python 3.9
213213
:sync: python38plus
214214
215215
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_multiple1_py38.py

docs/source/tutorials/repeating_tasks_with_different_inputs.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ different seeds and output paths as default arguments of the function.
2121
2222
````
2323
24-
````{tab-item} Python 3.8+
24+
````{tab-item} Python 3.9
2525
:sync: python38plus
2626
2727
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs1_py38.py
@@ -57,7 +57,7 @@ You can also add dependencies to repeated tasks just like with any other task.
5757
5858
````
5959
60-
````{tab-item} Python 3.8+
60+
````{tab-item} Python 3.9
6161
:sync: python38plus
6262
6363
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs2_py38.py
@@ -117,7 +117,7 @@ For example, the following function is parametrized with tuples.
117117
118118
````
119119
120-
````{tab-item} Python 3.8+
120+
````{tab-item} Python 3.9
121121
:sync: python38plus
122122
123123
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs3_py38.py
@@ -158,7 +158,7 @@ a unique name for the iteration.
158158
159159
````
160160
161-
````{tab-item} Python 3.8+
161+
````{tab-item} Python 3.9
162162
:sync: python38plus
163163
164164
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs4_py38.py
@@ -244,7 +244,7 @@ Following these three tips, the parametrization becomes
244244
245245
````
246246
247-
````{tab-item} Python 3.8+
247+
````{tab-item} Python 3.9
248248
:sync: python38plus
249249
250250
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs5_py38.py

docs/source/tutorials/using_a_data_catalog.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ of our tasks. Here we see again the signature of the task function.
6363
```
6464
````
6565
66-
````{tab-item} Python 3.8+
66+
````{tab-item} Python 3.9
6767
:sync: python38plus
6868
6969
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_products_py38.py
@@ -107,7 +107,7 @@ Use `data_catalog["data"]` as an default argument to access the
107107
108108
````
109109
110-
````{tab-item} Python 3.8+
110+
````{tab-item} Python 3.9
111111
:sync: python38plus
112112
113113
Use `data_catalog["data"]` as an default argument to access the
@@ -167,7 +167,7 @@ Following one of the interfaces gives you immediate access to the
167167
168168
````
169169
170-
````{tab-item} Python 3.8+
170+
````{tab-item} Python 3.9
171171
:sync: python38plus
172172
173173
```{literalinclude} ../../../docs_src/tutorials/using_a_data_catalog_3_py38.py
@@ -241,7 +241,7 @@ different node types which is not relevant now.
241241
242242
````
243243
244-
````{tab-item} Python 3.8+
244+
````{tab-item} Python 3.9
245245
:sync: python38plus
246246
247247
```{literalinclude} ../../../docs_src/tutorials/using_a_data_catalog_5_py38.py

docs/source/tutorials/write_a_task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ If you want to refresh your knowledge about type hints, read
6262
6363
````
6464
65-
````{tab-item} Python 3.8+
65+
````{tab-item} Python 3.9
6666
6767
The task accepts the argument `path` that points to the file where the data set will be
6868
stored. The path is passed to the task via the default value, `BLD / "data.pkl"`. To

docs_src/how_to_guides/bp_structure_of_task_files.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from pathlib import Path
2+
from typing import Annotated
23

34
import pandas as pd
45
from checks import perform_general_checks_on_data
5-
from typing_extensions import Annotated
66

77
from pytask import Product
88

docs_src/how_to_guides/capturing_warnings_1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
2+
from typing import Annotated
23

34
import pandas as pd
4-
from typing_extensions import Annotated
55

66
from pytask import Product
77

docs_src/how_to_guides/capturing_warnings_2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
2+
from typing import Annotated
23

34
import pandas as pd
4-
from typing_extensions import Annotated
55

66
import pytask
77
from pytask import Product

docs_src/how_to_guides/migrating_from_scripts_to_pytask_4.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Content of task_data_management.py
22
from pathlib import Path
3+
from typing import Annotated
34

45
import pandas as pd
5-
from typing_extensions import Annotated
66

77
from pytask import Product
88

docs_src/how_to_guides/migrating_from_scripts_to_pytask_5.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from pathlib import Path
2+
from typing import Annotated
23
from typing import Optional
34

45
import pandas as pd
5-
from typing_extensions import Annotated
66

77
from pytask import Product
88

docs_src/how_to_guides/provisional_products.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
2+
from typing import Annotated
23

34
import httpx
4-
from typing_extensions import Annotated
55

66
from pytask import DirectoryNode
77
from pytask import Product

docs_src/how_to_guides/provisional_task.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pathlib import Path
2-
3-
from typing_extensions import Annotated
2+
from typing import Annotated
43

54
from pytask import DirectoryNode
65

docs_src/how_to_guides/provisional_task_generator.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pathlib import Path
2-
3-
from typing_extensions import Annotated
2+
from typing import Annotated
43

54
from pytask import DirectoryNode
65
from pytask import task

docs_src/how_to_guides/using_task_returns_example_1_py38.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pathlib import Path
2-
3-
from typing_extensions import Annotated
2+
from typing import Annotated
43

54

65
def task_create_file() -> Annotated[str, Path("file.txt")]:

docs_src/how_to_guides/using_task_returns_example_3_py38.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pathlib import Path
2-
3-
from typing_extensions import Annotated
2+
from typing import Annotated
43

54

65
def task_create_files() -> Annotated[str, (Path("file1.txt"), Path("file2.txt"))]:

docs_src/how_to_guides/using_task_returns_example_4_py38.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
from typing import Annotated
12
from typing import Any
23

3-
from typing_extensions import Annotated
4-
54
from pytask import PythonNode
65

76
nodes = [

docs_src/how_to_guides/writing_custom_nodes_example_2_py38.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
2+
from typing import Annotated
23

34
import pandas as pd
4-
from typing_extensions import Annotated
55

66
from pytask import Product
77

docs_src/how_to_guides/writing_custom_nodes_example_2_py38_return.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
2+
from typing import Annotated
23

34
import pandas as pd
4-
from typing_extensions import Annotated
55

66

77
class PickleNode: ...

docs_src/tutorials/defining_dependencies_products_dependencies_py38.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from pathlib import Path
2+
from typing import Annotated
23

34
import matplotlib.pyplot as plt
45
import pandas as pd
56
from my_project.config import BLD
6-
from typing_extensions import Annotated
77

88
from pytask import Product
99

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from pathlib import Path
2-
from typing import Dict
32

43
from my_project.config import BLD
54

@@ -9,5 +8,5 @@
98
def task_plot_data(
109
path_to_data_0: Path = BLD / "data_0.pkl",
1110
path_to_data_1: Path = BLD / "data_1.pkl",
12-
produces: Dict[str, Path] = _PRODUCTS,
11+
produces: dict[str, Path] = _PRODUCTS,
1312
) -> None: ...

docs_src/tutorials/defining_dependencies_products_multiple1_py38.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
2+
from typing import Annotated
23

34
from my_project.config import BLD
4-
from typing_extensions import Annotated
55

66
from pytask import Product
77

0 commit comments

Comments
 (0)