Skip to content

Commit

Permalink
Update pre-commit hooks (#3460)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/python-jsonschema/check-jsonschema: 0.29.4 → 0.30.0](python-jsonschema/check-jsonschema@0.29.4...0.30.0)
- [github.com/astral-sh/ruff-pre-commit: v0.8.0 → v0.8.3](astral-sh/ruff-pre-commit@v0.8.0...v0.8.3)
- [github.com/rbubley/mirrors-prettier: v3.3.3 → v3.4.2](rbubley/mirrors-prettier@v3.3.3...v3.4.2)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ssbarnea and pre-commit-ci[bot] authored Dec 20, 2024
1 parent fbac078 commit c0b490d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/tox/execute/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})"
Expand Down
16 changes: 8 additions & 8 deletions tests/execute/local_subprocess/test_local_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0b490d

Please sign in to comment.