Skip to content

Commit 8b9fae3

Browse files
pre-commit-ci[bot]tobiasraabe
andauthoredFeb 4, 2024
[pre-commit.ci] pre-commit autoupdate (#556)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tobias Raabe <raabe@posteo.de>
1 parent 984b781 commit 8b9fae3

11 files changed

+24
-27
lines changed
 

‎.pre-commit-config.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ repos:
4545
hooks:
4646
- id: sort-all
4747
- repo: https://github.com/astral-sh/ruff-pre-commit
48-
rev: v0.1.14
48+
rev: v0.2.0
4949
hooks:
5050
- id: ruff-format
5151
- id: ruff
5252
args: [--unsafe-fixes]
5353
- repo: https://github.com/dosisod/refurb
54-
rev: v1.27.0
54+
rev: v1.28.0
5555
hooks:
5656
- id: refurb
5757
args: [--ignore, FURB126]
@@ -96,9 +96,8 @@ repos:
9696
- id: nbqa-isort
9797
- id: nbqa-mypy
9898
args: [--ignore-missing-imports]
99-
- id: nbqa-ruff
10099
- repo: https://github.com/kynan/nbstripout
101-
rev: 0.6.1
100+
rev: 0.6.2
102101
hooks:
103102
- id: nbstripout
104103
exclude: (docs)

‎docs/source/reference_guides/api.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ For example:
136136

137137
```python
138138
@pytask.mark.timeout(10, "slow", method="thread")
139-
def task_function():
140-
...
139+
def task_function(): ...
141140
```
142141

143142
Will create and attach a {class}`Mark <pytask.Mark>` object to the collected
@@ -154,8 +153,7 @@ Example for using multiple custom markers:
154153
```python
155154
@pytask.mark.timeout(10, "slow", method="thread")
156155
@pytask.mark.slow
157-
def task_function():
158-
...
156+
def task_function(): ...
159157
```
160158

161159
### Classes

‎docs/source/tutorials/repeating_tasks_with_different_inputs.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ the {func}`@task <pytask.task>` decorator to pass keyword arguments to the task.
268268
for id_, kwargs in ID_TO_KWARGS.items():
269269

270270
@task(id=id_, kwargs=kwargs)
271-
def task_create_random_data(seed, produces):
272-
...
271+
def task_create_random_data(seed, produces): ...
273272
```
274273

275274
Writing a function that creates `ID_TO_KWARGS` would be even more pythonic.
@@ -289,8 +288,7 @@ ID_TO_KWARGS = create_parametrization()
289288
for id_, kwargs in ID_TO_KWARGS.items():
290289

291290
@task(id=id_, kwargs=kwargs)
292-
def task_create_random_data(i, produces):
293-
...
291+
def task_create_random_data(i, produces): ...
294292
```
295293

296294
The {doc}`best-practices guide on parametrizations <../how_to_guides/bp_scaling_tasks>`

‎docs/source/tutorials/selecting_tasks.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ from pytask import task
9191
for i in range(2):
9292

9393
@task
94-
def task_parametrized(i=i):
95-
...
94+
def task_parametrized(i=i): ...
9695
```
9796

9897
To run the task where `i = 1`, run this command.

‎docs/source/tutorials/skipping_tasks.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ from config import NO_LONG_RUNNING_TASKS
4242

4343

4444
@pytask.mark.skipif(NO_LONG_RUNNING_TASKS, reason="Skip long-running tasks.")
45-
def task_that_takes_really_long_to_run(path: Path = Path("time_intensive_product.pkl")):
46-
...
45+
def task_that_takes_really_long_to_run(
46+
path: Path = Path("time_intensive_product.pkl"),
47+
): ...
4748
```
4849

4950
## Further reading

‎docs/source/tutorials/write_a_task.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,14 @@ from pytask import task
117117

118118

119119
@task
120-
def create_random_data():
121-
...
120+
def create_random_data(): ...
122121

123122

124123
# The id will be ".../task_data_preparation.py::create_data".
125124

126125

127126
@task(name="create_data")
128-
def create_random_data():
129-
...
127+
def create_random_data(): ...
130128
```
131129

132130
## Customize task module names

‎docs_src/how_to_guides/bp_scaling_tasks_2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ def task_prepare_data(
3434
path_to_processed_data: Annotated[Path, Product],
3535
) -> None:
3636
df = pd.read_csv(path_to_input_data)
37-
...
37+
# ... transform the data.
3838
subset = df.loc[df["subset"].eq(subset)]
3939
subset.to_pickle(path_to_processed_data)

‎docs_src/tutorials/using_a_data_catalog_5_py310.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ def task_transform_csv(
1212
node: Annotated[PickleNode, Product] = data_catalog["transformed_csv"],
1313
) -> None:
1414
df = pd.read_csv(path)
15-
...
15+
# ... transform the data.
1616
node.save(df)

‎docs_src/tutorials/using_a_data_catalog_5_py310_return.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ def task_transform_csv(
99
path: Annotated[Path, data_catalog["csv"]],
1010
) -> Annotated[pd.DataFrame, data_catalog["transformed_csv"]]:
1111
df = pd.read_csv(path)
12-
...
12+
# ... transform the data
1313
return df

‎docs_src/tutorials/using_a_data_catalog_5_py38.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ def task_transform_csv(
1212
node: Annotated[PickleNode, Product] = data_catalog["transformed_csv"],
1313
) -> None:
1414
df = pd.read_csv(path)
15-
...
15+
# ... transform the data
1616
node.save(df)

‎pyproject.toml

+7-3
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ namespaces = false
105105

106106
[tool.ruff]
107107
target-version = "py38"
108-
select = ["ALL"]
109108
fix = true
109+
extend-include = ["*.ipynb"]
110+
111+
[tool.ruff.lint]
112+
select = ["ALL"]
110113
ignore = [
111114
"FBT", # flake8-boolean-trap
112115
"I", # ignore isort
@@ -125,7 +128,7 @@ ignore = [
125128
]
126129

127130

128-
[tool.ruff.per-file-ignores]
131+
[tool.ruff.lint.per-file-ignores]
129132
"src/_pytask/_hashlib.py" = ["ALL"]
130133
"src/_pytask/capture.py" = ["PGH003"]
131134
"src/_pytask/hookspecs.py" = ["ARG001"]
@@ -141,9 +144,10 @@ ignore = [
141144
"docs/source/how_to_guides/functional_interface*" = ["B018", "D", "INP", "ARG005"]
142145
"docs_src/how_to_guides/using_task_returns_*_task.py" = ["ARG005", "E731"]
143146
"docs_src/how_to_guides/writing_custom_nodes_*.py" = ["S301"]
147+
"docs_src/tutorials/using_a_data_catalog_*.py" = ["RET504"]
144148

145149

146-
[tool.ruff.pydocstyle]
150+
[tool.ruff.lint.pydocstyle]
147151
convention = "numpy"
148152

149153
[tool.pytest.ini_options]

0 commit comments

Comments
 (0)
Please sign in to comment.