Skip to content

Commit 49d48ac

Browse files
[pre-commit.ci] pre-commit autoupdate (#54)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tobias Raabe <[email protected]>
1 parent 3db61a0 commit 49d48ac

File tree

6 files changed

+24
-19
lines changed

6 files changed

+24
-19
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ repos:
33
rev: v4.4.0
44
hooks:
55
- id: check-added-large-files
6-
args: ['--maxkb=100']
6+
args: ['--maxkb=25']
7+
- id: check-case-conflict
78
- id: check-merge-conflict
9+
- id: check-vcs-permalinks
810
- id: check-yaml
911
- id: debug-statements
1012
- id: end-of-file-fixer
13+
- id: fix-byte-order-marker
14+
- id: mixed-line-ending
15+
- id: no-commit-to-branch
16+
args: [--branch, main]
1117
- repo: https://github.com/pre-commit/pygrep-hooks
1218
rev: v1.10.0 # Use the ref you want to point at
1319
hooks:
@@ -26,21 +32,16 @@ repos:
2632
rev: v2.2.0
2733
hooks:
2834
- id: setup-cfg-fmt
29-
- repo: https://github.com/PYCQA/docformatter
30-
rev: v1.5.1
31-
hooks:
32-
- id: docformatter
33-
args: [--in-place, --wrap-summaries, "88", --wrap-descriptions, "88", --blank]
3435
- repo: https://github.com/psf/black
35-
rev: 22.12.0
36+
rev: 23.3.0
3637
hooks:
3738
- id: black
3839
- repo: https://github.com/charliermarsh/ruff-pre-commit
39-
rev: v0.0.223
40+
rev: v0.0.261
4041
hooks:
4142
- id: ruff
4243
- repo: https://github.com/dosisod/refurb
43-
rev: v1.10.0
44+
rev: v1.15.0
4445
hooks:
4546
- id: refurb
4647
args: [--ignore, FURB126]
@@ -59,11 +60,11 @@ repos:
5960
]
6061
args: [--wrap, "88"]
6162
- repo: https://github.com/codespell-project/codespell
62-
rev: v2.2.2
63+
rev: v2.2.4
6364
hooks:
6465
- id: codespell
6566
- repo: https://github.com/pre-commit/mirrors-mypy
66-
rev: 'v0.991'
67+
rev: 'v1.2.0'
6768
hooks:
6869
- id: mypy
6970
args: [

CHANGES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
55
releases are available on [PyPI](https://pypi.org/project/pytask-parallel) and
66
[Anaconda.org](https://anaconda.org/conda-forge/pytask-parallel).
77

8-
## 0.3.0 - 2023-xx-xx
8+
## 0.3.1 - 2023-xx-xx
9+
10+
## 0.3.0 - 2023-01-23
911

1012
- {pull}`50` deprecates INI configurations and aligns the package with pytask v0.3.
1113
- {pull}`51` adds ruff and refurb.

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ target-version = "py37"
2929
select = ["ALL"]
3030
fix = true
3131
extend-ignore = [
32+
"TRY", # ignore tryceratops.
33+
"TCH", # ignore non-guarded type imports.
3234
# Numpy docstyle
3335
"D107",
3436
"D203",
@@ -52,6 +54,8 @@ extend-ignore = [
5254
"ANN401", # flake8-annotate typing.Any
5355
"PD", # pandas-vet
5456
"COM812", # trailing comma missing, but black takes care of that
57+
"D401", # imperative mood for first line. too many false-positives.
58+
"SLF001", # access private members.
5559
]
5660

5761

src/pytask_parallel/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@hookimpl
1313
def pytask_parse_config(config: dict[str, Any]) -> None:
1414
"""Parse the configuration."""
15-
if config["n_workers"] == "auto": # noqa: PLR2004
15+
if config["n_workers"] == "auto":
1616
config["n_workers"] = max(os.cpu_count() - 1, 1)
1717

1818
if (

src/pytask_parallel/execute.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def pytask_post_parse(config: dict[str, Any]) -> None:
4141

4242

4343
@hookimpl(tryfirst=True)
44-
def pytask_execute_build(session: Session) -> bool | None:
44+
def pytask_execute_build(session: Session) -> bool | None: # noqa: C901, PLR0915
4545
"""Execute tasks with a parallel backend.
4646
4747
There are three phases while the scheduler has tasks which need to be executed.
@@ -59,12 +59,10 @@ def pytask_execute_build(session: Session) -> bool | None:
5959
parallel_backend = PARALLEL_BACKENDS[session.config["parallel_backend"]]
6060

6161
with parallel_backend(max_workers=session.config["n_workers"]) as executor:
62-
6362
session.config["_parallel_executor"] = executor
6463
sleeper = _Sleeper()
6564

6665
while session.scheduler.is_active():
67-
6866
try:
6967
newly_collected_reports = []
7068
n_new_tasks = session.config["n_workers"] - len(running_tasks)
@@ -197,7 +195,7 @@ def pytask_execute_task(session: Session, task: Task) -> Future[Any] | None:
197195
return None
198196

199197

200-
def _unserialize_and_execute_task(
198+
def _unserialize_and_execute_task( # noqa: PLR0913
201199
bytes_function: bytes,
202200
bytes_kwargs: bytes,
203201
show_locals: bool,

tests/test_execute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ def task_5():
209209

210210
assert session.exit_code == ExitCode.OK
211211
first_task_name = session.execution_reports[0].task.name
212-
assert first_task_name.endswith("task_0") or first_task_name.endswith("task_3")
212+
assert first_task_name.endswith(("task_0", "task_3"))
213213
last_task_name = session.execution_reports[-1].task.name
214-
assert last_task_name.endswith("task_2") or last_task_name.endswith("task_5")
214+
assert last_task_name.endswith(("task_2", "task_5"))
215215

216216

217217
@pytest.mark.end_to_end()

0 commit comments

Comments
 (0)