Skip to content

Commit d87e6ed

Browse files
committed
Update pre-commit hooks
1 parent c7f2caf commit d87e6ed

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: 0.29.4
8+
rev: 0.30.0
99
hooks:
1010
- id: check-github-workflows
1111
args: ["--verbose"]
@@ -23,7 +23,7 @@ repos:
2323
hooks:
2424
- id: validate-pyproject
2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: "v0.8.0"
26+
rev: "v0.8.2"
2727
hooks:
2828
- id: ruff-format
2929
- id: ruff
@@ -38,7 +38,7 @@ repos:
3838
hooks:
3939
- id: rst-backticks
4040
- repo: https://github.com/rbubley/mirrors-prettier
41-
rev: "v3.3.3"
41+
rev: "v3.4.2"
4242
hooks:
4343
- id: prettier
4444
- repo: local

src/tox/execute/request.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def shell_cmd(self) -> str:
5959
exe = str(Path(self.cmd[0]).relative_to(self.cwd))
6060
except ValueError:
6161
exe = self.cmd[0]
62-
_cmd = [exe]
63-
_cmd.extend(self.cmd[1:])
64-
return shell_cmd(_cmd)
62+
cmd = [exe]
63+
cmd.extend(self.cmd[1:])
64+
return shell_cmd(cmd)
6565

6666
def __repr__(self) -> str:
6767
return f"{self.__class__.__name__}(cmd={self.cmd!r}, cwd={self.cwd!r}, env=..., stdin={self.stdin!r})"

src/tox/pytest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ def _invalid_index_fake_port() -> int:
492492

493493

494494
@pytest.fixture(autouse=True)
495-
def disable_pip_pypi_access(_invalid_index_fake_port: int, monkeypatch: pytest.MonkeyPatch) -> tuple[str, str | None]:
495+
def disable_pip_pypi_access(invalid_index_fake_port: int, monkeypatch: pytest.MonkeyPatch) -> tuple[str, str | None]:
496496
"""Set a fake pip index url, tests that want to use a pypi server should create and overwrite this."""
497497
previous_url = os.environ.get("PIP_INDEX_URL")
498-
new_url = f"http://localhost:{_invalid_index_fake_port}/bad-pypi-server"
498+
new_url = f"http://localhost:{invalid_index_fake_port}/bad-pypi-server"
499499
monkeypatch.setenv("PIP_INDEX_URL", new_url)
500500
monkeypatch.setenv("PIP_RETRIES", str(0))
501501
monkeypatch.setenv("PIP_TIMEOUT", str(0.001))

src/tox/tox_env/python/virtual_env/package/util.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ def _extract_extra_markers(req: Requirement) -> tuple[Requirement, set[str | Non
7373
return req, cast("Set[Optional[str]]", extra_markers) or {None}
7474

7575

76-
def _get_extra(_marker: str | tuple[Variable, Op, Variable]) -> str | None:
76+
def _get_extra(marker: str | tuple[Variable, Op, Variable]) -> str | None:
7777
if (
78-
isinstance(_marker, tuple)
79-
and len(_marker) == 3 # noqa: PLR2004
80-
and _marker[0].value == "extra"
81-
and _marker[1].value == "=="
78+
isinstance(marker, tuple)
79+
and len(marker) == 3 # noqa: PLR2004
80+
and marker[0].value == "extra"
81+
and marker[1].value == "=="
8282
):
83-
return _marker[2].value
83+
return marker[2].value
8484
return None

tests/execute/local_subprocess/test_local_subprocess.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,14 @@ def test_local_execute_basic_fail(capsys: CaptureFixture, caplog: LogCaptureFixt
234234
assert record.levelno == logging.CRITICAL
235235
assert record.msg == "exit %s (%.2f seconds) %s> %s%s"
236236
assert record.args is not None
237-
_code, _duration, _cwd, _cmd, _metadata = record.args
238-
assert _code == 3
239-
assert _cwd == cwd
240-
assert _cmd == request.shell_cmd
241-
assert isinstance(_duration, float)
242-
assert _duration > 0
243-
assert isinstance(_metadata, str)
244-
assert _metadata.startswith(" pid=")
237+
code, duration, cwd_, cmd_, metadata = record.args
238+
assert code == 3
239+
assert cwd_ == cwd
240+
assert cmd_ == request.shell_cmd
241+
assert isinstance(duration, float)
242+
assert duration > 0
243+
assert isinstance(metadata, str)
244+
assert metadata.startswith(" pid=")
245245

246246

247247
def test_command_does_not_exist(caplog: LogCaptureFixture, os_env: dict[str, str]) -> None:

tests/test_provision.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ def _make_tox_wheel(
6262
into = tmp_path_factory.mktemp("dist") # pragma: no cover
6363
from tox.version import version_tuple # noqa: PLC0415
6464

65-
_patch_version = version_tuple[2]
66-
if isinstance(_patch_version, str) and _patch_version[:3] == "dev":
65+
patch_version = version_tuple[2]
66+
if isinstance(patch_version, str) and patch_version[:3] == "dev":
6767
# Version is in the form of 1.23.dev456, we need to increment the 456 part
68-
version = f"{version_tuple[0]}.{version_tuple[1]}.dev{int(_patch_version[3:]) + 1}"
68+
version = f"{version_tuple[0]}.{version_tuple[1]}.dev{int(patch_version[3:]) + 1}"
6969
else:
70-
version = f"{version_tuple[0]}.{version_tuple[1]}.{int(_patch_version) + 1}"
70+
version = f"{version_tuple[0]}.{version_tuple[1]}.{int(patch_version) + 1}"
7171

7272
with mock.patch.dict(os.environ, {"SETUPTOOLS_SCM_PRETEND_VERSION": version}):
7373
return pkg_builder(into, Path(__file__).parents[1], ["wheel"], False) # pragma: no cover

0 commit comments

Comments
 (0)