diff --git a/bin/update_pythons.py b/bin/update_pythons.py index bddd6a89..930b13df 100755 --- a/bin/update_pythons.py +++ b/bin/update_pythons.py @@ -65,7 +65,6 @@ AnyConfig = Union[ConfigWinCP, ConfigWinPP, ConfigMacOS] class WindowsVersions: def __init__(self, arch_str: ArchStr) -> None: - response = requests.get("https://api.nuget.org/v3/index.json") response.raise_for_status() api_info = response.json() @@ -88,7 +87,6 @@ class WindowsVersions: self.version_dict = {Version(v): v for v in cp_info["versions"]} def update_version_windows(self, spec: Specifier) -> ConfigWinCP | None: - # Specifier.filter selects all non pre-releases that match the spec, # unless there are only pre-releases, then it selects pre-releases # instead (like pip) @@ -111,7 +109,6 @@ class WindowsVersions: class PyPyVersions: def __init__(self, arch_str: ArchStr): - response = requests.get("https://downloads.python.org/pypy/versions.json") response.raise_for_status() @@ -191,7 +188,6 @@ class PyPyVersions: class CPythonVersions: def __init__(self) -> None: - response = requests.get( "https://www.python.org/api/v2/downloads/release/?is_published=true" ) @@ -210,7 +206,6 @@ class CPythonVersions: def update_version_macos( self, identifier: str, version: Version, spec: Specifier ) -> ConfigMacOS | None: - # see note above on Specifier.filter unsorted_versions = spec.filter(self.versions_dict) sorted_versions = sorted(unsorted_versions, reverse=True) @@ -296,7 +291,6 @@ class AllVersions: "--level", default="INFO", type=click.Choice(["WARNING", "INFO", "DEBUG"], case_sensitive=False) ) def update_pythons(force: bool, level: str) -> None: - logging.basicConfig( level="INFO", format="%(message)s", diff --git a/bin/update_virtualenv.py b/bin/update_virtualenv.py index 3704463d..ef1fec80 100755 --- a/bin/update_virtualenv.py +++ b/bin/update_virtualenv.py @@ -72,7 +72,6 @@ def git_ls_remote_versions(url) -> list[VersionTuple]: "--level", default="INFO", type=click.Choice(["WARNING", "INFO", "DEBUG"], case_sensitive=False) ) def update_virtualenv(force: bool, level: str) -> None: - logging.basicConfig( level="INFO", format="%(message)s", diff --git a/cibuildwheel/architecture.py b/cibuildwheel/architecture.py index 7be0bb3a..e1c8482a 100644 --- a/cibuildwheel/architecture.py +++ b/cibuildwheel/architecture.py @@ -134,7 +134,6 @@ def allowed_architectures_check( platform: PlatformName, architectures: set[Architecture], ) -> None: - allowed_architectures = Architecture.all_archs(platform) msg = f"{PRETTY_NAMES[platform]} only supports {sorted(allowed_architectures)} at the moment." diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index e3b7b032..acf00667 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -48,7 +48,6 @@ def get_python_configurations( build_selector: BuildSelector, architectures: set[Architecture], ) -> list[PythonConfiguration]: - full_python_configs = read_python_configs("linux") python_configurations = [PythonConfiguration(**item) for item in full_python_configs] @@ -224,7 +223,6 @@ def build_in_container( ) repaired_wheels = [compatible_wheel] else: - if build_options.before_build: log.step("Running before_build...") before_build_prepared = prepare_command( @@ -421,7 +419,6 @@ def build(options: Options, tmp_path: Path) -> None: # noqa: ARG001 cwd=container_project_path, engine=options.globals.container_engine, ) as container: - build_in_container( options=options, platform_configs=build_step.platform_configs, @@ -446,7 +443,6 @@ def _matches_prepared_command(error_cmd: list[str], command_template: str) -> bo def troubleshoot(options: Options, error: Exception) -> None: - if isinstance(error, subprocess.CalledProcessError) and ( error.cmd[0:4] == ["python", "-m", "pip", "wheel"] or error.cmd[0:3] == ["python", "-m", "build"] diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index 2b7f91a5..a94caa66 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -71,7 +71,6 @@ class PythonConfiguration: def get_python_configurations( build_selector: BuildSelector, architectures: set[Architecture] ) -> list[PythonConfiguration]: - full_python_configs = read_python_configs("macos") python_configurations = [PythonConfiguration(**item) for item in full_python_configs] @@ -460,7 +459,7 @@ def build(options: Options, tmp_path: Path) -> None: env=env, capture_stdout=True, ).strip() - testing_archs: list[Literal["x86_64", "arm64"]] # noqa: F821 + testing_archs: list[Literal["x86_64", "arm64"]] if config_is_arm64: testing_archs = ["arm64"] diff --git a/cibuildwheel/oci_container.py b/cibuildwheel/oci_container.py index abac02b2..b92acceb 100644 --- a/cibuildwheel/oci_container.py +++ b/cibuildwheel/oci_container.py @@ -68,7 +68,6 @@ class OCIContainer: self.engine = engine def __enter__(self) -> OCIContainer: - self.name = f"cibuildwheel-{uuid.uuid4()}" # work-around for Travis-CI PPC64le Docker runs since 2021: @@ -130,7 +129,6 @@ class OCIContainer: exc_val: BaseException | None, exc_tb: TracebackType | None, ) -> None: - self.bash_stdin.write(b"exit 0\n") self.bash_stdin.flush() self.process.wait(timeout=30) @@ -244,7 +242,6 @@ class OCIContainer: capture_output: bool = False, cwd: PathOrStr | None = None, ) -> str: - if cwd is None: # Podman does not start the a container in a specific working dir # so we always need to specify it when making calls. diff --git a/cibuildwheel/options.py b/cibuildwheel/options.py index b1534970..6b7b335f 100644 --- a/cibuildwheel/options.py +++ b/cibuildwheel/options.py @@ -44,7 +44,7 @@ from .util import ( @dataclasses.dataclass class CommandLineArguments: - platform: Literal["auto", "linux", "macos", "windows"] | None # noqa: F821 + platform: Literal["auto", "linux", "macos", "windows"] | None archs: str | None output_dir: Path only: str | None diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index d81e2e51..9182f046 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -73,7 +73,6 @@ def get_python_configurations( build_selector: BuildSelector, architectures: set[Architecture], ) -> list[PythonConfiguration]: - full_python_configs = read_python_configs("windows") python_configurations = [PythonConfiguration(**item) for item in full_python_configs] diff --git a/test/test_pep518.py b/test/test_pep518.py index 0f1bc0c5..557ead46 100644 --- a/test/test_pep518.py +++ b/test/test_pep518.py @@ -35,7 +35,6 @@ build-backend = "setuptools.build_meta" def test_pep518(tmp_path, build_frontend_env): - project_dir = tmp_path / "project" basic_project.generate(project_dir) diff --git a/unit_test/main_tests/main_platform_test.py b/unit_test/main_tests/main_platform_test.py index b9c6af13..79424821 100644 --- a/unit_test/main_tests/main_platform_test.py +++ b/unit_test/main_tests/main_platform_test.py @@ -75,7 +75,6 @@ def test_platform_environment(intercepted_build_args): def test_archs_default(platform, intercepted_build_args): - main() options = intercepted_build_args.args[0] @@ -89,7 +88,6 @@ def test_archs_default(platform, intercepted_build_args): @pytest.mark.parametrize("use_env_var", [False, True]) def test_archs_argument(platform, intercepted_build_args, monkeypatch, use_env_var): - if use_env_var: monkeypatch.setenv("CIBW_ARCHS", "ppc64le") else: diff --git a/unit_test/main_tests/main_requires_python_test.py b/unit_test/main_tests/main_requires_python_test.py index e21c1dbc..75820c45 100644 --- a/unit_test/main_tests/main_requires_python_test.py +++ b/unit_test/main_tests/main_requires_python_test.py @@ -27,7 +27,6 @@ def fake_package_dir(monkeypatch, tmp_path): @pytest.mark.usefixtures("platform") def test_no_override(intercepted_build_args): - main() options = intercepted_build_args.args[0] @@ -56,7 +55,6 @@ def test_override_env(monkeypatch, intercepted_build_args): @pytest.mark.usefixtures("platform") def test_override_setup_cfg(intercepted_build_args, fake_package_dir): - fake_package_dir.joinpath("setup.cfg").write_text( textwrap.dedent( """ @@ -79,7 +77,6 @@ def test_override_setup_cfg(intercepted_build_args, fake_package_dir): @pytest.mark.usefixtures("platform") def test_override_pyproject_toml(intercepted_build_args, fake_package_dir): - fake_package_dir.joinpath("pyproject.toml").write_text( textwrap.dedent( """ @@ -102,7 +99,6 @@ def test_override_pyproject_toml(intercepted_build_args, fake_package_dir): @pytest.mark.usefixtures("platform") def test_override_setup_py_simple(intercepted_build_args, fake_package_dir): - fake_package_dir.joinpath("setup.py").write_text( textwrap.dedent( """