diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index a6eb29695..2693f4f3d 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -287,8 +287,6 @@ def setup_python( "pip", "install", "--upgrade", - "setuptools", - "wheel", "delocate", *dependency_constraint_flags, env=env, diff --git a/cibuildwheel/resources/constraints-python310.txt b/cibuildwheel/resources/constraints-python310.txt index 990e12151..04b1cb58b 100644 --- a/cibuildwheel/resources/constraints-python310.txt +++ b/cibuildwheel/resources/constraints-python310.txt @@ -4,6 +4,8 @@ # # nox -s update_constraints-3.10 # +build==1.0.3 + # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 @@ -11,18 +13,22 @@ distlib==0.3.8 filelock==3.13.1 # via virtualenv packaging==23.2 - # via delocate + # via + # build + # delocate platformdirs==4.2.0 # via virtualenv +pyproject-hooks==1.0.0 + # via build +tomli==2.0.1 + # via + # build + # pyproject-hooks typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 # via -r cibuildwheel/resources/constraints.in -wheel==0.42.0 - # via -r cibuildwheel/resources/constraints.in # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r cibuildwheel/resources/constraints.in -setuptools==69.1.1 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python311.txt b/cibuildwheel/resources/constraints-python311.txt index 9293ac028..eb122a989 100644 --- a/cibuildwheel/resources/constraints-python311.txt +++ b/cibuildwheel/resources/constraints-python311.txt @@ -4,6 +4,8 @@ # # nox -s update_constraints-3.11 # +build==1.0.3 + # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 @@ -11,18 +13,18 @@ distlib==0.3.8 filelock==3.13.1 # via virtualenv packaging==23.2 - # via delocate + # via + # build + # delocate platformdirs==4.2.0 # via virtualenv +pyproject-hooks==1.0.0 + # via build typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 # via -r cibuildwheel/resources/constraints.in -wheel==0.42.0 - # via -r cibuildwheel/resources/constraints.in # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r cibuildwheel/resources/constraints.in -setuptools==69.1.1 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python312.txt b/cibuildwheel/resources/constraints-python312.txt index 4dee0f5df..513b48681 100644 --- a/cibuildwheel/resources/constraints-python312.txt +++ b/cibuildwheel/resources/constraints-python312.txt @@ -4,6 +4,8 @@ # # nox -s update_constraints-3.12 # +build==1.0.3 + # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 @@ -11,18 +13,18 @@ distlib==0.3.8 filelock==3.13.1 # via virtualenv packaging==23.2 - # via delocate + # via + # build + # delocate platformdirs==4.2.0 # via virtualenv +pyproject-hooks==1.0.0 + # via build typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 # via -r cibuildwheel/resources/constraints.in -wheel==0.42.0 - # via -r cibuildwheel/resources/constraints.in # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r cibuildwheel/resources/constraints.in -setuptools==69.1.1 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python36.txt b/cibuildwheel/resources/constraints-python36.txt index 9e04d7436..ff4e8609d 100644 --- a/cibuildwheel/resources/constraints-python36.txt +++ b/cibuildwheel/resources/constraints-python36.txt @@ -4,18 +4,33 @@ # # nox -s update_constraints-3.6 # +build==0.9.0 + # via -r cibuildwheel/resources/constraints.in delocate==0.10.2 # via -r cibuildwheel/resources/constraints.in -distlib==0.3.6 +distlib==0.3.8 # via virtualenv filelock==3.4.1 # via virtualenv importlib-metadata==4.8.3 - # via virtualenv + # via + # build + # pep517 + # virtualenv importlib-resources==5.4.0 # via virtualenv +packaging==21.3 + # via build +pep517==0.13.1 + # via build platformdirs==2.4.0 # via virtualenv +pyparsing==3.1.1 + # via packaging +tomli==1.2.3 + # via + # build + # pep517 typing-extensions==4.1.1 # via # delocate @@ -23,16 +38,13 @@ typing-extensions==4.1.1 virtualenv==20.17.1 # via -r cibuildwheel/resources/constraints.in wheel==0.37.1 - # via - # -r cibuildwheel/resources/constraints.in - # delocate + # via delocate zipp==3.6.0 # via # importlib-metadata # importlib-resources + # pep517 # The following packages are considered to be unsafe in a requirements file: pip==21.3.1 # via -r cibuildwheel/resources/constraints.in -setuptools==59.6.0 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python37.txt b/cibuildwheel/resources/constraints-python37.txt index 44d9f6bc1..40870c098 100644 --- a/cibuildwheel/resources/constraints-python37.txt +++ b/cibuildwheel/resources/constraints-python37.txt @@ -4,6 +4,8 @@ # # nox -s update_constraints-3.7 # +build==1.0.3 + # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 @@ -11,11 +13,21 @@ distlib==0.3.8 filelock==3.12.2 # via virtualenv importlib-metadata==6.7.0 - # via virtualenv + # via + # build + # virtualenv packaging==23.2 - # via delocate + # via + # build + # delocate platformdirs==4.0.0 # via virtualenv +pyproject-hooks==1.0.0 + # via build +tomli==2.0.1 + # via + # build + # pyproject-hooks typing-extensions==4.7.1 # via # delocate @@ -23,13 +35,9 @@ typing-extensions==4.7.1 # platformdirs virtualenv==20.25.1 # via -r cibuildwheel/resources/constraints.in -wheel==0.42.0 - # via -r cibuildwheel/resources/constraints.in zipp==3.15.0 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r cibuildwheel/resources/constraints.in -setuptools==68.0.0 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python38.txt b/cibuildwheel/resources/constraints-python38.txt index 4356afe7a..1df4d72e7 100644 --- a/cibuildwheel/resources/constraints-python38.txt +++ b/cibuildwheel/resources/constraints-python38.txt @@ -4,25 +4,35 @@ # # nox -s update_constraints-3.8 # +build==1.0.3 + # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 # via virtualenv filelock==3.13.1 # via virtualenv +importlib-metadata==7.0.1 + # via build packaging==23.2 - # via delocate + # via + # build + # delocate platformdirs==4.2.0 # via virtualenv +pyproject-hooks==1.0.0 + # via build +tomli==2.0.1 + # via + # build + # pyproject-hooks typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 # via -r cibuildwheel/resources/constraints.in -wheel==0.42.0 - # via -r cibuildwheel/resources/constraints.in +zipp==3.17.0 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r cibuildwheel/resources/constraints.in -setuptools==69.1.1 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python39.txt b/cibuildwheel/resources/constraints-python39.txt index a87079639..6f97862f7 100644 --- a/cibuildwheel/resources/constraints-python39.txt +++ b/cibuildwheel/resources/constraints-python39.txt @@ -4,25 +4,35 @@ # # nox -s update_constraints-3.9 # +build==1.0.3 + # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 # via virtualenv filelock==3.13.1 # via virtualenv +importlib-metadata==7.0.1 + # via build packaging==23.2 - # via delocate + # via + # build + # delocate platformdirs==4.2.0 # via virtualenv +pyproject-hooks==1.0.0 + # via build +tomli==2.0.1 + # via + # build + # pyproject-hooks typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 # via -r cibuildwheel/resources/constraints.in -wheel==0.42.0 - # via -r cibuildwheel/resources/constraints.in +zipp==3.17.0 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r cibuildwheel/resources/constraints.in -setuptools==69.1.1 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints.in b/cibuildwheel/resources/constraints.in index 9753106ac..50bfabb6e 100644 --- a/cibuildwheel/resources/constraints.in +++ b/cibuildwheel/resources/constraints.in @@ -1,5 +1,4 @@ pip -setuptools -wheel +build delocate virtualenv diff --git a/cibuildwheel/resources/constraints.txt b/cibuildwheel/resources/constraints.txt index 4dee0f5df..513b48681 100644 --- a/cibuildwheel/resources/constraints.txt +++ b/cibuildwheel/resources/constraints.txt @@ -4,6 +4,8 @@ # # nox -s update_constraints-3.12 # +build==1.0.3 + # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 @@ -11,18 +13,18 @@ distlib==0.3.8 filelock==3.13.1 # via virtualenv packaging==23.2 - # via delocate + # via + # build + # delocate platformdirs==4.2.0 # via virtualenv +pyproject-hooks==1.0.0 + # via build typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 # via -r cibuildwheel/resources/constraints.in -wheel==0.42.0 - # via -r cibuildwheel/resources/constraints.in # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r cibuildwheel/resources/constraints.in -setuptools==69.1.1 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 08bc77331..3cc92f921 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -315,17 +315,7 @@ def setup_python( call("pip", "--version", env=env) log.step("Installing build tools...") - if build_frontend == "pip": - call( - "pip", - "install", - "--upgrade", - "setuptools", - "wheel", - *dependency_constraint_flags, - env=env, - ) - elif build_frontend == "build": + if build_frontend == "build": call( "pip", "install", @@ -334,8 +324,6 @@ def setup_python( *dependency_constraint_flags, env=env, ) - else: - assert_never(build_frontend) if python_libs_base: # Set up the environment for various backends to enable cross-compilation diff --git a/test/test_dependency_versions.py b/test/test_dependency_versions.py index 90d7660db..739e8d0ac 100644 --- a/test/test_dependency_versions.py +++ b/test/test_dependency_versions.py @@ -27,13 +27,11 @@ print('Gathered versions', versions) - for package_name in ['pip', 'setuptools', 'wheel']: - env_name = 'EXPECTED_{}_VERSION'.format(package_name.upper()) - expected_version = os.environ[env_name] + expected_version = os.environ['EXPECTED_PIP_VERSION'] - assert '{}=={}'.format(package_name, expected_version) in versions, ( - 'error: {} version should equal {}'.format(package_name, expected_version) - ) + assert f'pip=={expected_version}' in versions, ( + f'error: pip version should equal {expected_version}' + ) """ ) ) @@ -48,7 +46,7 @@ def get_versions_from_constraint_file(constraint_file): return dict(re.findall(VERSION_REGEX, constraint_file_text)) -@pytest.mark.parametrize("python_version", ["3.6", "3.8", "3.9"]) +@pytest.mark.parametrize("python_version", ["3.6", "3.8", "3.10"]) def test_pinned_versions(tmp_path, python_version, build_frontend_env): if utils.platform == "linux": pytest.skip("linux doesn't pin individual tool versions, it pins manylinux images instead") @@ -70,15 +68,13 @@ def test_pinned_versions(tmp_path, python_version, build_frontend_env): constraint_filename = "constraints-python38.txt" build_pattern = "[cp]p38-*" else: - constraint_filename = "constraints.txt" - build_pattern = "[cp]p39-*" + constraint_filename = "constraints-python310.txt" + build_pattern = "[cp]p310-*" constraint_file = cibuildwheel.util.resources_dir / constraint_filename constraint_versions = get_versions_from_constraint_file(constraint_file) - for package in ["pip", "setuptools", "wheel", "virtualenv"]: - env_name = f"EXPECTED_{package.upper()}_VERSION" - build_environment[env_name] = constraint_versions[package] + build_environment["EXPECTED_PIP_VERSION"] = constraint_versions["pip"] cibw_environment_option = " ".join(f"{k}={v}" for k, v in build_environment.items()) @@ -101,9 +97,9 @@ def test_pinned_versions(tmp_path, python_version, build_frontend_env): expected_wheels = [ w for w in utils.expected_wheels("spam", "0.1.0") if "-cp38" in w or "-pp38" in w ] - elif python_version == "3.9": + elif python_version == "3.10": expected_wheels = [ - w for w in utils.expected_wheels("spam", "0.1.0") if "-cp39" in w or "-pp39" in w + w for w in utils.expected_wheels("spam", "0.1.0") if "-cp310" in w or "-pp310" in w ] else: msg = "unhandled python version" @@ -121,9 +117,7 @@ def test_dependency_constraints_file(tmp_path, build_frontend_env): tool_versions = { "pip": "23.1.2", - "setuptools": "67.7.2", - "wheel": "0.38.3", - "virtualenv": "20.23.0", + "delocate": "0.10.3", } constraints_file = tmp_path / "constraints file.txt" @@ -131,9 +125,7 @@ def test_dependency_constraints_file(tmp_path, build_frontend_env): textwrap.dedent( """ pip=={pip} - setuptools=={setuptools} - wheel=={wheel} - virtualenv=={virtualenv} + delocate=={delocate} importlib-metadata<3,>=0.12; python_version < "3.8" """.format(**tool_versions) )