diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d0bcbdca..5f9c33ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.249 + rev: v0.0.253 hooks: - id: ruff args: ["--fix"] diff --git a/cibuildwheel/environment.py b/cibuildwheel/environment.py index fd17175d..74bfd78a 100644 --- a/cibuildwheel/environment.py +++ b/cibuildwheel/environment.py @@ -117,7 +117,7 @@ class ParsedEnvironment: prev_environment: Mapping[str, str], executor: bashlex_eval.EnvironmentExecutor | None = None, ) -> dict[str, str]: - environment = dict(**prev_environment) + environment = {**prev_environment} for assignment in self.assignments: value = assignment.evaluated_value(environment=environment, executor=executor) diff --git a/cibuildwheel/util.py b/cibuildwheel/util.py index fe9e3487..c0af8182 100644 --- a/cibuildwheel/util.py +++ b/cibuildwheel/util.py @@ -543,8 +543,8 @@ def _parse_constraints_for_virtualenv( constraint_path = Path(dependency_constraint_flags[1]) assert constraint_path.exists() with constraint_path.open(encoding="utf-8") as constraint_file: - for line in constraint_file: - line = line.strip() + for line_ in constraint_file: + line = line_.strip() if not line: continue if line.startswith("#"): diff --git a/pyproject.toml b/pyproject.toml index e53b0c68..4573b9f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -115,6 +115,7 @@ messages_control.disable = [ "unsubscriptable-object", "wrong-import-position", "unused-argument", # Handled by Ruff + "broad-exception-raised", # Could be improved eventually ] [tool.ruff] diff --git a/test/test_projects/base.py b/test/test_projects/base.py index c4ea5403..5da5928c 100644 --- a/test/test_projects/base.py +++ b/test/test_projects/base.py @@ -33,7 +33,7 @@ class TestProject: with file_path.open("w", encoding="utf8") as f: if isinstance(content, jinja2.Template): - content = content.render(self.template_context) + content = content.render(self.template_context) # noqa: PLW2901 f.write(content)