From 9b757b61eebe833f71d118d0adaf5e93389ff3fb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:51:39 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.29.4 → 0.30.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.29.4...0.30.0) - [github.com/astral-sh/ruff-pre-commit: v0.8.0 → v0.8.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.0...v0.8.3) - [github.com/rbubley/mirrors-prettier: v3.3.3 → v3.4.2](https://github.com/rbubley/mirrors-prettier/compare/v3.3.3...v3.4.2) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 96dd990af..0bab65a74 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.4 + rev: 0.30.0 hooks: - id: check-github-workflows args: ["--verbose"] @@ -23,7 +23,7 @@ repos: hooks: - id: validate-pyproject - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.0" + rev: "v0.8.3" hooks: - id: ruff-format - id: ruff @@ -38,7 +38,7 @@ repos: hooks: - id: rst-backticks - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.3.3" + rev: "v3.4.2" hooks: - id: prettier - repo: local From e5121cb653a8b435698af4d332af3dd046983718 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:52:16 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/tox/execute/request.py | 6 +++--- .../local_subprocess/test_local_subprocess.py | 16 ++++++++-------- tests/test_provision.py | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/tox/execute/request.py b/src/tox/execute/request.py index f84d50a78..817444080 100644 --- a/src/tox/execute/request.py +++ b/src/tox/execute/request.py @@ -59,9 +59,9 @@ def shell_cmd(self) -> str: exe = str(Path(self.cmd[0]).relative_to(self.cwd)) except ValueError: exe = self.cmd[0] - _cmd = [exe] - _cmd.extend(self.cmd[1:]) - return shell_cmd(_cmd) + cmd = [exe] + cmd.extend(self.cmd[1:]) + return shell_cmd(cmd) def __repr__(self) -> str: return f"{self.__class__.__name__}(cmd={self.cmd!r}, cwd={self.cwd!r}, env=..., stdin={self.stdin!r})" diff --git a/tests/execute/local_subprocess/test_local_subprocess.py b/tests/execute/local_subprocess/test_local_subprocess.py index 2bfb542e8..d3ed37da7 100644 --- a/tests/execute/local_subprocess/test_local_subprocess.py +++ b/tests/execute/local_subprocess/test_local_subprocess.py @@ -234,14 +234,14 @@ def test_local_execute_basic_fail(capsys: CaptureFixture, caplog: LogCaptureFixt assert record.levelno == logging.CRITICAL assert record.msg == "exit %s (%.2f seconds) %s> %s%s" assert record.args is not None - _code, _duration, _cwd, _cmd, _metadata = record.args - assert _code == 3 - assert _cwd == cwd - assert _cmd == request.shell_cmd - assert isinstance(_duration, float) - assert _duration > 0 - assert isinstance(_metadata, str) - assert _metadata.startswith(" pid=") + code, duration, cwd_, cmd_, metadata = record.args + assert code == 3 + assert cwd_ == cwd + assert cmd_ == request.shell_cmd + assert isinstance(duration, float) + assert duration > 0 + assert isinstance(metadata, str) + assert metadata.startswith(" pid=") def test_command_does_not_exist(caplog: LogCaptureFixture, os_env: dict[str, str]) -> None: diff --git a/tests/test_provision.py b/tests/test_provision.py index 5b2b652b3..2030cb922 100644 --- a/tests/test_provision.py +++ b/tests/test_provision.py @@ -62,12 +62,12 @@ def _make_tox_wheel( into = tmp_path_factory.mktemp("dist") # pragma: no cover from tox.version import version_tuple # noqa: PLC0415 - _patch_version = version_tuple[2] - if isinstance(_patch_version, str) and _patch_version[:3] == "dev": + patch_version = version_tuple[2] + if isinstance(patch_version, str) and patch_version[:3] == "dev": # Version is in the form of 1.23.dev456, we need to increment the 456 part - version = f"{version_tuple[0]}.{version_tuple[1]}.dev{int(_patch_version[3:]) + 1}" + version = f"{version_tuple[0]}.{version_tuple[1]}.dev{int(patch_version[3:]) + 1}" else: - version = f"{version_tuple[0]}.{version_tuple[1]}.{int(_patch_version) + 1}" + version = f"{version_tuple[0]}.{version_tuple[1]}.{int(patch_version) + 1}" with mock.patch.dict(os.environ, {"SETUPTOOLS_SCM_PRETEND_VERSION": version}): return pkg_builder(into, Path(__file__).parents[1], ["wheel"], False) # pragma: no cover