From 3222c5bdf8895608c1d49910c08b1e07a7a3eadf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 17:11:38 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit.git: v0.15.9 → v0.16.10](https://github.com/astral-sh/ruff-pre-commit.git/compare/v0.15.9...v0.16.10) - [github.com/astral-sh/ruff-pre-commit.git: v0.15.9 → v0.16.10](https://github.com/astral-sh/ruff-pre-commit.git/compare/v0.15.9...v0.16.10) - [github.com/astral-sh/ruff-pre-commit.git: v0.15.9 → v0.16.10](https://github.com/astral-sh/ruff-pre-commit.git/compare/v0.15.9...v0.16.10) - [github.com/python-jsonschema/check-jsonschema.git: 0.37.1 → 0.38.2](https://github.com/python-jsonschema/check-jsonschema.git/compare/0.37.1...0.38.2) - [github.com/codespell-project/codespell.git: v2.4.2 → v2.4.3](https://github.com/codespell-project/codespell.git/compare/v2.4.2...v2.4.3) - [github.com/shellcheck-py/shellcheck-py.git: v0.11.0.1 → v0.11.0.1-1](https://github.com/shellcheck-py/shellcheck-py.git/compare/v0.11.0.1...v0.11.0.1-1) - [github.com/Lucas-C/pre-commit-hooks-lxml.git: v1.1.0 → v1.1.1](https://github.com/Lucas-C/pre-commit-hooks-lxml.git/compare/v1.1.0...v1.1.1) - [github.com/PyCQA/flake8.git: 7.3.0 → 7.4.1](https://github.com/PyCQA/flake8.git/compare/7.3.0...7.4.1) - [github.com/pre-commit/mirrors-mypy.git: v1.19.1 → v2.4.0](https://github.com/pre-commit/mirrors-mypy.git/compare/v1.19.1...v2.4.0) - [github.com/PyCQA/pylint.git: v3.3.9 → v4.1.2](https://github.com/PyCQA/pylint.git/compare/v3.3.9...v4.1.2) - [github.com/rhysd/actionlint.git: v1.7.10 → v1.7.12](https://github.com/rhysd/actionlint.git/compare/v1.7.10...v1.7.12) --- .pre-commit-config.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d1dfe93..2f40932 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,7 +38,7 @@ repos: - id: no_optional - repo: https://github.com/astral-sh/ruff-pre-commit.git - rev: v0.15.9 + rev: v0.16.10 hooks: - id: ruff-check args: @@ -48,7 +48,7 @@ repos: - --show-fixes - repo: https://github.com/astral-sh/ruff-pre-commit.git - rev: v0.15.9 + rev: v0.16.10 hooks: - id: ruff-format alias: ruff-format-first-pass @@ -60,7 +60,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit.git - rev: v0.15.9 + rev: v0.16.10 hooks: - id: ruff-format alias: ruff-format-second-pass @@ -72,7 +72,7 @@ repos: - id: remove-tabs - repo: https://github.com/python-jsonschema/check-jsonschema.git - rev: 0.37.1 + rev: 0.38.2 hooks: - id: check-github-workflows files: ^\.github/workflows/[^/]+$ @@ -131,7 +131,7 @@ repos: - id: debug-statements - repo: https://github.com/codespell-project/codespell.git - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell @@ -151,17 +151,17 @@ repos: - id: bashate - repo: https://github.com/shellcheck-py/shellcheck-py.git - rev: v0.11.0.1 + rev: v0.11.0.1-1 hooks: - id: shellcheck - repo: https://github.com/Lucas-C/pre-commit-hooks-lxml.git - rev: v1.1.0 + rev: v1.1.1 hooks: - id: forbid-html-img-without-alt-text - repo: https://github.com/PyCQA/flake8.git - rev: 7.3.0 + rev: 7.4.1 hooks: - id: flake8 additional_dependencies: @@ -179,7 +179,7 @@ repos: language_version: python3 - repo: https://github.com/pre-commit/mirrors-mypy.git - rev: v1.19.1 + rev: v2.4.0 hooks: - id: mypy alias: mypy-py315 @@ -285,7 +285,7 @@ repos: pass_filenames: false - repo: https://github.com/PyCQA/pylint.git - rev: v3.3.9 + rev: v4.1.2 hooks: - id: pylint additional_dependencies: @@ -297,7 +297,7 @@ repos: - tox [testing] >= 4.54.0 - repo: https://github.com/rhysd/actionlint.git - rev: v1.7.10 + rev: v1.7.12 hooks: - id: actionlint additional_dependencies: From 79dae8f9635dc6f766c27422b26bd22dde51ab5e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 17:16:53 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/tox_plugins/pre_commit/_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tox_plugins/pre_commit/_plugin.py b/src/tox_plugins/pre_commit/_plugin.py index bee24f0..2402bcc 100644 --- a/src/tox_plugins/pre_commit/_plugin.py +++ b/src/tox_plugins/pre_commit/_plugin.py @@ -38,7 +38,7 @@ def tox_extend_envs() -> _c.Iterable[str]: @impl def tox_add_core_config( - core_conf: ConfigSet, # noqa: ARG001 # pylint: disable=unused-argument + core_conf: ConfigSet, # ruff: ignore[unused-function-argument] # pylint: disable=unused-argument state: State, ) -> None: """Inject default configuration for the pre-commit environment. From c07f9fab206a59667b0dc587f180dbea6d7eab14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Mon, 5 Oct 2026 13:02:39 -0700 Subject: [PATCH 3/3] fix: preserve test environment isolation Request isolation through pytest configuration after tox starts its environment checker. Pluggy accepts the hook without its unused argument. --- .ruff.toml | 14 +++++++------- pytest.ini | 1 + src/tox_plugins/pre_commit/_plugin.py | 3 --- tests/conftest.py | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index 712b7d2..6190ff5 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -13,14 +13,14 @@ external = [ "WPS", # Do not remove noqa for wemake-python-style (WPS) checks ] ignore = [ - "CPY001", # Skip copyright notice requirement at top of files + "missing-copyright-notice", # Skip copyright notice requirement at top of files # Refs: # * https://github.com/astral-sh/ruff/issues/6606 # * https://github.com/astral-sh/ruff/pull/13286 - "DOC201", # Ruff doesn't understand sphinx-native param lists - "DOC402", # Ruff doesn't understand sphinx-native param lists - "DOC501", # docstring-missing-exception # Ruff doesn't understand sphinx-native param lists + "docstring-missing-returns", # Ruff doesn't understand sphinx-native param lists + "docstring-missing-yields", # Ruff doesn't understand sphinx-native param lists + "docstring-missing-exception", # docstring-missing-exception # Ruff doesn't understand sphinx-native param lists ] preview = true # Live dangerously select = [ @@ -84,9 +84,9 @@ testing = [ # If other ignores are added for a specific file in the section following this, # these will need to be added to that line as well. - "PLC2701", # Allow importing internal files needed for testing - "PLR0913", # Allow parametrized + fixture test signatures with many args - "S101", # Allow use of `assert` in test files + "import-private-name", # Allow importing internal files needed for testing + "too-many-arguments", # Allow parametrized + fixture test signatures with many args + "assert", # Allow use of `assert` in test files ] [lint.pydocstyle] diff --git a/pytest.ini b/pytest.ini index dd64b72..0fec1de 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,5 @@ [pytest] +usefixtures = check_os_environ_stable _isolate_user_environment addopts = # `pytest-xdist`: --numprocesses=auto diff --git a/src/tox_plugins/pre_commit/_plugin.py b/src/tox_plugins/pre_commit/_plugin.py index 2402bcc..224264e 100644 --- a/src/tox_plugins/pre_commit/_plugin.py +++ b/src/tox_plugins/pre_commit/_plugin.py @@ -13,7 +13,6 @@ if _t.TYPE_CHECKING: from collections import abc as _c # noqa: WPS347 - from tox.config.sets import ConfigSet from tox.session.state import State @@ -38,12 +37,10 @@ def tox_extend_envs() -> _c.Iterable[str]: @impl def tox_add_core_config( - core_conf: ConfigSet, # ruff: ignore[unused-function-argument] # pylint: disable=unused-argument state: State, ) -> None: """Inject default configuration for the pre-commit environment. - :param core_conf: The core tox configuration set (unused). :param state: The tox session state to inject environments into. """ pos_args = state.conf.pos_args(to_path=None) diff --git a/tests/conftest.py b/tests/conftest.py index 02fd59e..117dafd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,7 +10,7 @@ pytest_plugins = ('tox.pytest',) -@pytest.fixture(autouse=True) +@pytest.fixture def _isolate_user_environment(monkeypatch: pytest.MonkeyPatch) -> None: """Isolate the tests from the user's tox configuration.