From 3347933a4e3d5cda8f993ffccc3f79b5a01a819c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:13:03 -0800 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#3214) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- src/tox/session/env_select.py | 2 +- src/tox/tox_env/api.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a822bfed..b6f08e58e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: - id: blacken-docs additional_dependencies: [black==23.12.1] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.14 + rev: v0.2.0 hooks: - id: ruff-format - id: ruff diff --git a/src/tox/session/env_select.py b/src/tox/session/env_select.py index a654eaa49..d332795c4 100644 --- a/src/tox/session/env_select.py +++ b/src/tox/session/env_select.py @@ -189,7 +189,7 @@ def _ensure_envs_valid(self) -> None: for env in self._cli_envs or []: if env.startswith(".pkg_external"): # external package continue - factors: dict[str, str | None] = {k: None for k in env.split("-")} + factors: dict[str, str | None] = dict.fromkeys(env.split("-")) found_factors: set[str] = set() for factor in factors: if ( diff --git a/src/tox/tox_env/api.py b/src/tox/tox_env/api.py index 5b4bb7c30..1d17473e4 100644 --- a/src/tox/tox_env/api.py +++ b/src/tox/tox_env/api.py @@ -139,7 +139,7 @@ def register_config(self) -> None: def pass_env_post_process(values: list[str]) -> list[str]: values.extend(self._default_pass_env()) - result = sorted({k: None for k in values}.keys()) + result = sorted(dict.fromkeys(values).keys()) invalid_chars = set(string.whitespace) invalid = [v for v in result if any(c in invalid_chars for c in v)] if invalid: