Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#3427)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Oct 28, 2024
1 parent ab51e14 commit fc5ea9f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ repos:
- id: codespell
additional_dependencies: ["tomli>=2.0.1"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.4.3"
rev: "v2.4.3"
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.21"
rev: "v0.22"
hooks:
- id: validate-pyproject
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.0"
rev: "v0.7.1"
hooks:
- id: ruff-format
- id: ruff
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
- repo: https://github.com/asottile/blacken-docs
rev: 1.19.0
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies: [black==24.8]
Expand Down
2 changes: 1 addition & 1 deletion src/tox/config/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def parse_args( # type: ignore[override] # avoid defining all overloads
res, argv = self.parse_known_args(args, namespace)
if argv:
self.error(
f'unrecognized arguments: {" ".join(argv)}\n'
f"unrecognized arguments: {' '.join(argv)}\n"
"hint: if you tried to pass arguments to a command use -- to separate them from tox ones",
)
return res
Expand Down
4 changes: 2 additions & 2 deletions src/tox/tox_env/python/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def extract_base_python(cls, env_name: str) -> str | None:
match = PY_FACTORS_RE_EXPLICIT_VERSION.match(env_name)
if match:
found = match.groupdict()
candidates.append(f'{"pypy" if found["impl"] == "pypy" else ""}{found["version"]}')
candidates.append(f"{'pypy' if found['impl'] == 'pypy' else ''}{found['version']}")
else:
for factor in env_name.split("-"):
match = PY_FACTORS_RE.match(factor)
Expand Down Expand Up @@ -251,7 +251,7 @@ def _diff_msg(conf: dict[str, Any], old: dict[str, Any]) -> str:
changed = [f"{k}={old[k]!r}->{v!r}" for k, v in conf.items() if k in old and v != old[k]]
if changed:
result.append(f"changed {' | '.join(changed)}")
return f'python {", ".join(result)}'
return f"python {', '.join(result)}"

@abstractmethod
def prepend_env_var_path(self) -> list[Path]:
Expand Down
2 changes: 1 addition & 1 deletion src/tox/tox_env/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_package_env_types(self) -> tuple[str, str] | None:
self.conf.add_config(
keys=["package_env"],
of_type=str,
default=f'{self.core["package_env"]}{"_external" if has_external_pkg else ""}',
default=f"{self.core['package_env']}{'_external' if has_external_pkg else ''}",
desc="tox environment used to package",
)
is_external = self.conf["package"] == "external"
Expand Down
2 changes: 1 addition & 1 deletion tests/config/source/test_toml_pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def test_config_set_env_ref(tox_project: ToxProjectCreator) -> None:
]
"""
})
outcome = project.run("c", "-e" "t", "-k", "set_env", "--hashseed", "1")
outcome = project.run("c", "-et", "-k", "set_env", "--hashseed", "1")
outcome.assert_success()
out = (
"[testenv:t]\n"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def test_custom_work_dir(tox_project: ToxProjectCreator, tmp_path: Path) -> None
assert outcome.state.conf.core["work_dir"], f"should set work_dir to {expected_work_dir}"

assert outcome.state.conf.core["tox_root"] == expected_tox_root, "should not update the value of tox_root"
assert outcome.state.conf.core["work_dir"] != (
expected_tox_root / ".tox"
), "should explicitly demonstrate that tox_root and work_dir are decoupled"
assert outcome.state.conf.core["work_dir"] != (expected_tox_root / ".tox"), (
"should explicitly demonstrate that tox_root and work_dir are decoupled"
)

# should update config values that depend on work_dir
assert outcome.state.conf.core["temp_dir"] == expected_work_dir / ".tmp"
Expand Down
2 changes: 1 addition & 1 deletion tests/tox_env/python/pip/req/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def test_req_path_with_space_escape(tmp_path: Path) -> None:
dep_requirements_file = tmp_path / "a b"
dep_requirements_file.write_text("c")
path = f"-r {dep_requirements_file!s}"
path = f'{path[: -len("a b")]}a\\ b'
path = f"{path[: -len('a b')]}a\\ b"

requirements_file = tmp_path / "req.txt"
requirements_file.write_text(path)
Expand Down

0 comments on commit fc5ea9f

Please sign in to comment.