From 1d7df392b1245c3e518c95172e18dfe1d10ba542 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 20:21:21 +0000 Subject: [PATCH 1/2] [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: v0.4.10 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.10...v0.5.0) - [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.10.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 832e33d73..42951e47e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,14 +14,14 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.10 + rev: v0.5.0 hooks: - id: ruff args: ["--fix", "--show-fixes"] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v1.10.1 hooks: - id: mypy name: mypy 3.8 on cibuildwheel/ From fbd181f631902a70b1e4bd211e63ae4eff0dfda3 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 1 Jul 2024 20:48:44 -0400 Subject: [PATCH 2/2] style follow suggestion Signed-off-by: Henry Schreiner --- cibuildwheel/projectfiles.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cibuildwheel/projectfiles.py b/cibuildwheel/projectfiles.py index 73593fc74..c1a376696 100644 --- a/cibuildwheel/projectfiles.py +++ b/cibuildwheel/projectfiles.py @@ -39,10 +39,8 @@ def is_main(parent: ast.AST | None) -> bool: if len(mains) != 1: return False consts = {x for x in values if isinstance(x, ast.Name) and x.id == "__name__"} - if len(consts) != 1: - return False - return True + return len(consts) == 1 class Analyzer(ast.NodeVisitor):