Skip to content

Commit 47bcea6

Browse files
[pre-commit.ci] pre-commit autoupdate (#3217)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent fb83a3a commit 47bcea6

File tree

14 files changed

+49
-42
lines changed

14 files changed

+49
-42
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: ""
88

99
## Issue
1010

11-
<!-- Describe what's the expected behaviour and what you're observing. -->
11+
<!-- Describe what's the expected behavior and what you're observing. -->
1212

1313
## Environment
1414

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: check
22
on:
33
workflow_dispatch:
44
push:
5-
branches: "main"
5+
branches: ["main"]
66
tags-ignore: [ "**" ]
77
pull_request:
88
schedule:

.pre-commit-config.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,37 @@ repos:
44
hooks:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
7+
- repo: https://github.com/python-jsonschema/check-jsonschema
8+
rev: 0.28.0
9+
hooks:
10+
- id: check-github-workflows
11+
args: [ "--verbose" ]
712
- repo: https://github.com/codespell-project/codespell
813
rev: v2.2.6
914
hooks:
1015
- id: codespell
11-
args: ["--ignore-words-list", "crate,releas", "--skip", "*.svg"]
12-
additional_dependencies:
13-
- tomli>=2.0.1
16+
additional_dependencies: ["tomli>=2.0.1"]
1417
- repo: https://github.com/tox-dev/tox-ini-fmt
15-
rev: 1.3.1
18+
rev: "1.3.1"
1619
hooks:
1720
- id: tox-ini-fmt
1821
args: ["-p", "fix"]
1922
- repo: https://github.com/tox-dev/pyproject-fmt
20-
rev: 1.7.0
23+
rev: "1.7.0"
2124
hooks:
2225
- id: pyproject-fmt
23-
additional_dependencies: ["tox>=4.11.4"]
24-
- repo: https://github.com/asottile/blacken-docs
25-
rev: 1.16.0
26-
hooks:
27-
- id: blacken-docs
28-
additional_dependencies: [black==23.12.1]
26+
additional_dependencies: ["tox>=4.12.1"]
2927
- repo: https://github.com/astral-sh/ruff-pre-commit
30-
rev: v0.1.14
28+
rev: "v0.2.1"
3129
hooks:
3230
- id: ruff-format
3331
- id: ruff
3432
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
33+
- repo: https://github.com/asottile/blacken-docs
34+
rev: 1.16.0
35+
hooks:
36+
- id: blacken-docs
37+
additional_dependencies: [black==23.12.1]
3538
- repo: https://github.com/pre-commit/pygrep-hooks
3639
rev: v1.10.0
3740
hooks:

docs/changelog.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,8 @@ v4.1.2 (2022-12-30)
559559

560560
Bugfixes - 4.1.2
561561
~~~~~~~~~~~~~~~~
562-
- Fix ``--skip-missing-interpreters`` behaviour - by :user:`q0w`. (:issue:`2649`)
563-
- Restore tox 3 behaviour of showing the output of pip freeze, however now only active when running inside a CI
562+
- Fix ``--skip-missing-interpreters`` behavior - by :user:`q0w`. (:issue:`2649`)
563+
- Restore tox 3 behavior of showing the output of pip freeze, however now only active when running inside a CI
564564
environment - by :user:`gaborbernat`. (:issue:`2685`)
565565
- Fix extracting extras from markers with many extras - by :user:`q0w`. (:issue:`2791`)
566566

@@ -614,7 +614,7 @@ Features - 4.0.17
614614

615615
Bugfixes - 4.0.17
616616
~~~~~~~~~~~~~~~~~
617-
- Fix ``--sdistonly`` behaviour. (:issue:`2653`)
617+
- Fix ``--sdistonly`` behavior. (:issue:`2653`)
618618
- Override toxworkdir with --workdir. (:issue:`2654`)
619619

620620

docs/changelog/3197.doc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Development: summarise important points experienced developers need to know - by :user:`0cjs`.
1+
Development: summarize important points experienced developers need to know - by :user:`0cjs`.

docs/config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ Run
454454
.. note::
455455

456456
Inline scripts can be used, however note these are discovered from the project root directory, and is not
457-
influenced by :ref:`change_dir` (this only affects the runtime current working directory). To make this behaviour
457+
influenced by :ref:`change_dir` (this only affects the runtime current working directory). To make this behavior
458458
explicit we recommend that you make inline scripts absolute paths by prepending ``{tox_root}``, instead of
459459
``path/to/my_script`` prefer ``{tox_root}{/}path{/}to{/}my_script``. If your inline script is platform dependent
460460
refer to :ref:`platform-specification` on how to select different script per platform.

ignore-words.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
releas
2+
master

pyproject.toml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ build.targets.sdist.include = ["/src", "/tests", "/tox.ini"]
103103
version.source = "vcs"
104104

105105
[tool.ruff]
106-
select = ["ALL"]
107106
line-length = 120
108107
target-version = "py38"
109-
isort = { known-first-party = ["tox", "tests"], required-imports = ["from __future__ import annotations"] }
110-
ignore = [
108+
lint.isort = { known-first-party = ["tox", "tests"], required-imports = ["from __future__ import annotations"] }
109+
lint.select = ["ALL"]
110+
lint.ignore = [
111111
"CPY", # No copyright header
112112
"INP001", # no implicit namespaces here
113113
"D", # ignore documentation for now
@@ -118,21 +118,16 @@ ignore = [
118118
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
119119
"S104", # Possible binding to all interfaces
120120
"COM812", # conflicts with formatter
121-
"COM819", # conflicts with formatter
122-
"E501", # conflicts with formatter
123121
"ISC001", # conflicts with formatter
124-
"Q000", # conflicts with formatter
125-
"Q001", # conflicts with formatter
126-
"Q002", # conflicts with formatter
127-
"Q003", # conflicts with formatter
128-
"W191", # conflicts with formatter
129122
"S404", # Using subprocess is alright.
130123
"PLR0914", ## Too many local variables
131124
"PLR0917", ## Too many positional arguments
132125
]
133126
format.preview = true
134127
lint.preview = true
135-
[tool.ruff.per-file-ignores]
128+
format.docstring-code-format = true
129+
format.docstring-code-line-length = 100
130+
[tool.ruff.lint.per-file-ignores]
136131
"tests/**/*.py" = [
137132
"S101", # asserts allowed in tests...
138133
"FBT", # don"t care about booleans as positional arguments in tests
@@ -142,6 +137,13 @@ lint.preview = true
142137
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
143138
]
144139

140+
[tool.codespell]
141+
builtin = "clear,usage,en-GB_to_en-US"
142+
write-changes = true
143+
skip = "*.svg"
144+
ignore-words = "ignore-words.txt"
145+
count = true
146+
145147
[tool.pytest.ini_options]
146148
testpaths = ["tests"]
147149
addopts = "--tb=auto -ra --showlocals --no-success-flaky-report"

src/tox/config/set_env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self, raw: str, name: str, env_name: str | None, root: Path) -> Non
2020
self._name, self._env_name, self._root = name, env_name, root
2121
from .loader.ini.replace import MatchExpression, find_replace_expr # noqa: PLC0415
2222

23-
for line in raw.splitlines():
23+
for line in raw.splitlines(): # noqa: PLR1702
2424
if line.strip():
2525
if line.startswith("file|"):
2626
self._env_files.append(line[len("file|") :])

src/tox/plugin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
tox uses `pluggy <https://pluggy.readthedocs.io/en/stable/>`_ to customize the default behaviour. It provides an
2+
tox uses `pluggy <https://pluggy.readthedocs.io/en/stable/>`_ to customize the default behavior. It provides an
33
extension mechanism for plugin management an calling hooks.
44
55
Pluggy discovers a plugin by looking up for entry-points named ``tox``, for example in a pyproject.toml:

src/tox/session/cmd/run/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ def execute(state: State, max_workers: int | None, has_spinner: bool, live: bool
256256
interrupt.set()
257257
# cancel in reverse order to not allow submitting new jobs as we cancel running ones
258258
for future, tox_env in reversed(list(future_to_env.items())):
259-
cancelled = future.cancel()
260-
# if cannot be cancelled and not done -> still runs
261-
if cancelled is False and not future.done(): # pragma: no branch
259+
canceled = future.cancel()
260+
# if cannot be canceled and not done -> still runs
261+
if canceled is False and not future.done(): # pragma: no branch
262262
tox_env.interrupt()
263263
done.wait()
264264
# workaround for https://bugs.python.org/issue45274
@@ -310,7 +310,7 @@ def _queue_and_wait( # noqa: C901, PLR0913, PLR0915
310310
spinner: ToxSpinner,
311311
live: bool, # noqa: FBT001
312312
) -> None:
313-
try:
313+
try: # noqa: PLR1702
314314
options = state._options # noqa: SLF001
315315
with spinner:
316316
max_workers = len(to_run_list) if max_workers is None else max_workers

src/tox/session/env_select.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def _ensure_envs_valid(self) -> None:
189189
for env in self._cli_envs or []:
190190
if env.startswith(".pkg_external"): # external package
191191
continue
192-
factors: dict[str, str | None] = {k: None for k in env.split("-")}
192+
factors: dict[str, str | None] = dict.fromkeys(env.split("-"))
193193
found_factors: set[str] = set()
194194
for factor in factors:
195195
if (
@@ -247,7 +247,7 @@ def _defined_envs(self) -> dict[str, _ToxEnvInfo]: # noqa: C901, PLR0912
247247
# we need to redefine it, e.g. when it shows up in config as [testenv:.package] and afterwards by a run env is
248248
# marked as package_env.
249249

250-
if self._defined_envs_ is None:
250+
if self._defined_envs_ is None: # noqa: PLR1702
251251
self._defined_envs_ = {}
252252
failed: dict[str, Exception] = {}
253253
env_name_to_active = self._env_name_to_active()

src/tox/tox_env/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def register_config(self) -> None:
139139

140140
def pass_env_post_process(values: list[str]) -> list[str]:
141141
values.extend(self._default_pass_env())
142-
result = sorted({k: None for k in values}.keys())
142+
result = sorted(dict.fromkeys(values).keys())
143143
invalid_chars = set(string.whitespace)
144144
invalid = [v for v in result if any(c in invalid_chars for c in v)]
145145
if invalid:
@@ -436,7 +436,7 @@ def execute_async( # noqa: PLR0913
436436
finally:
437437
self._execute_statuses.pop(execute_id)
438438
if show and self._hidden_outcomes is not None and execute_status.outcome is not None:
439-
# if it gets cancelled before even starting
439+
# if it gets canceled before even starting
440440
self._hidden_outcomes.append(execute_status.outcome)
441441
if self.journal and execute_status.outcome is not None:
442442
self.journal.add_execute(execute_status.outcome, run_id)

src/tox/util/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def visit(vertex: str) -> dict[str, None] | None:
5858
return None
5959
visited.add(vertex)
6060
path[vertex] = None
61-
for neighbour in graph.get(vertex, ()):
62-
if neighbour in path or visit(neighbour):
61+
for neighbor in graph.get(vertex, ()):
62+
if neighbor in path or visit(neighbor):
6363
return path
6464
del path[vertex]
6565
return None

0 commit comments

Comments
 (0)