From c72e27e65a7b287675f5b3173364c1554cd13820 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 08:43:58 -0500 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#1423) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/charliermarsh/ruff-pre-commit: v0.0.249 → v0.0.253](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.249...v0.0.253) * fix ruff warnings * chore: fix pylint warnings Signed-off-by: Henry Schreiner --------- Signed-off-by: Henry Schreiner Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Grzegorz Bokota Co-authored-by: Henry Schreiner --- .pre-commit-config.yaml | 2 +- cibuildwheel/environment.py | 2 +- cibuildwheel/util.py | 4 ++-- pyproject.toml | 1 + test/test_projects/base.py | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) 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)