Merge pull request #1725 from pypa/constraints-cleanup

Don't preinstall setuptools and wheel, remove from constraints
This commit is contained in:
Joe Rickerby
2024-02-28 09:16:30 +00:00
committed by GitHub
12 changed files with 109 additions and 80 deletions
-2
View File
@@ -287,8 +287,6 @@ def setup_python(
"pip", "pip",
"install", "install",
"--upgrade", "--upgrade",
"setuptools",
"wheel",
"delocate", "delocate",
*dependency_constraint_flags, *dependency_constraint_flags,
env=env, env=env,
@@ -4,6 +4,8 @@
# #
# nox -s update_constraints-3.10 # nox -s update_constraints-3.10
# #
build==1.0.3
# via -r cibuildwheel/resources/constraints.in
delocate==0.10.7 delocate==0.10.7
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.3.8 distlib==0.3.8
@@ -11,18 +13,22 @@ distlib==0.3.8
filelock==3.13.1 filelock==3.13.1
# via virtualenv # via virtualenv
packaging==23.2 packaging==23.2
# via delocate # via
# build
# delocate
platformdirs==4.2.0 platformdirs==4.2.0
# via virtualenv # via virtualenv
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
# via
# build
# pyproject-hooks
typing-extensions==4.10.0 typing-extensions==4.10.0
# via delocate # via delocate
virtualenv==20.25.1 virtualenv==20.25.1
# via -r cibuildwheel/resources/constraints.in # 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: # The following packages are considered to be unsafe in a requirements file:
pip==24.0 pip==24.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
setuptools==69.1.1
# via -r cibuildwheel/resources/constraints.in
@@ -4,6 +4,8 @@
# #
# nox -s update_constraints-3.11 # nox -s update_constraints-3.11
# #
build==1.0.3
# via -r cibuildwheel/resources/constraints.in
delocate==0.10.7 delocate==0.10.7
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.3.8 distlib==0.3.8
@@ -11,18 +13,18 @@ distlib==0.3.8
filelock==3.13.1 filelock==3.13.1
# via virtualenv # via virtualenv
packaging==23.2 packaging==23.2
# via delocate # via
# build
# delocate
platformdirs==4.2.0 platformdirs==4.2.0
# via virtualenv # via virtualenv
pyproject-hooks==1.0.0
# via build
typing-extensions==4.10.0 typing-extensions==4.10.0
# via delocate # via delocate
virtualenv==20.25.1 virtualenv==20.25.1
# via -r cibuildwheel/resources/constraints.in # 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: # The following packages are considered to be unsafe in a requirements file:
pip==24.0 pip==24.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
setuptools==69.1.1
# via -r cibuildwheel/resources/constraints.in
@@ -4,6 +4,8 @@
# #
# nox -s update_constraints-3.12 # nox -s update_constraints-3.12
# #
build==1.0.3
# via -r cibuildwheel/resources/constraints.in
delocate==0.10.7 delocate==0.10.7
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.3.8 distlib==0.3.8
@@ -11,18 +13,18 @@ distlib==0.3.8
filelock==3.13.1 filelock==3.13.1
# via virtualenv # via virtualenv
packaging==23.2 packaging==23.2
# via delocate # via
# build
# delocate
platformdirs==4.2.0 platformdirs==4.2.0
# via virtualenv # via virtualenv
pyproject-hooks==1.0.0
# via build
typing-extensions==4.10.0 typing-extensions==4.10.0
# via delocate # via delocate
virtualenv==20.25.1 virtualenv==20.25.1
# via -r cibuildwheel/resources/constraints.in # 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: # The following packages are considered to be unsafe in a requirements file:
pip==24.0 pip==24.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
setuptools==69.1.1
# via -r cibuildwheel/resources/constraints.in
@@ -4,18 +4,33 @@
# #
# nox -s update_constraints-3.6 # nox -s update_constraints-3.6
# #
build==0.9.0
# via -r cibuildwheel/resources/constraints.in
delocate==0.10.2 delocate==0.10.2
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.3.6 distlib==0.3.8
# via virtualenv # via virtualenv
filelock==3.4.1 filelock==3.4.1
# via virtualenv # via virtualenv
importlib-metadata==4.8.3 importlib-metadata==4.8.3
# via virtualenv # via
# build
# pep517
# virtualenv
importlib-resources==5.4.0 importlib-resources==5.4.0
# via virtualenv # via virtualenv
packaging==21.3
# via build
pep517==0.13.1
# via build
platformdirs==2.4.0 platformdirs==2.4.0
# via virtualenv # via virtualenv
pyparsing==3.1.1
# via packaging
tomli==1.2.3
# via
# build
# pep517
typing-extensions==4.1.1 typing-extensions==4.1.1
# via # via
# delocate # delocate
@@ -23,16 +38,13 @@ typing-extensions==4.1.1
virtualenv==20.17.1 virtualenv==20.17.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
wheel==0.37.1 wheel==0.37.1
# via # via delocate
# -r cibuildwheel/resources/constraints.in
# delocate
zipp==3.6.0 zipp==3.6.0
# via # via
# importlib-metadata # importlib-metadata
# importlib-resources # importlib-resources
# pep517
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
pip==21.3.1 pip==21.3.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
setuptools==59.6.0
# via -r cibuildwheel/resources/constraints.in
@@ -4,6 +4,8 @@
# #
# nox -s update_constraints-3.7 # nox -s update_constraints-3.7
# #
build==1.0.3
# via -r cibuildwheel/resources/constraints.in
delocate==0.10.7 delocate==0.10.7
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.3.8 distlib==0.3.8
@@ -11,11 +13,21 @@ distlib==0.3.8
filelock==3.12.2 filelock==3.12.2
# via virtualenv # via virtualenv
importlib-metadata==6.7.0 importlib-metadata==6.7.0
# via virtualenv # via
# build
# virtualenv
packaging==23.2 packaging==23.2
# via delocate # via
# build
# delocate
platformdirs==4.0.0 platformdirs==4.0.0
# via virtualenv # via virtualenv
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
# via
# build
# pyproject-hooks
typing-extensions==4.7.1 typing-extensions==4.7.1
# via # via
# delocate # delocate
@@ -23,13 +35,9 @@ typing-extensions==4.7.1
# platformdirs # platformdirs
virtualenv==20.25.1 virtualenv==20.25.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
wheel==0.42.0
# via -r cibuildwheel/resources/constraints.in
zipp==3.15.0 zipp==3.15.0
# via importlib-metadata # via importlib-metadata
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
pip==24.0 pip==24.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
setuptools==68.0.0
# via -r cibuildwheel/resources/constraints.in
@@ -4,25 +4,35 @@
# #
# nox -s update_constraints-3.8 # nox -s update_constraints-3.8
# #
build==1.0.3
# via -r cibuildwheel/resources/constraints.in
delocate==0.10.7 delocate==0.10.7
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.3.8 distlib==0.3.8
# via virtualenv # via virtualenv
filelock==3.13.1 filelock==3.13.1
# via virtualenv # via virtualenv
importlib-metadata==7.0.1
# via build
packaging==23.2 packaging==23.2
# via delocate # via
# build
# delocate
platformdirs==4.2.0 platformdirs==4.2.0
# via virtualenv # via virtualenv
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
# via
# build
# pyproject-hooks
typing-extensions==4.10.0 typing-extensions==4.10.0
# via delocate # via delocate
virtualenv==20.25.1 virtualenv==20.25.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
wheel==0.42.0 zipp==3.17.0
# via -r cibuildwheel/resources/constraints.in # via importlib-metadata
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
pip==24.0 pip==24.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
setuptools==69.1.1
# via -r cibuildwheel/resources/constraints.in
@@ -4,25 +4,35 @@
# #
# nox -s update_constraints-3.9 # nox -s update_constraints-3.9
# #
build==1.0.3
# via -r cibuildwheel/resources/constraints.in
delocate==0.10.7 delocate==0.10.7
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.3.8 distlib==0.3.8
# via virtualenv # via virtualenv
filelock==3.13.1 filelock==3.13.1
# via virtualenv # via virtualenv
importlib-metadata==7.0.1
# via build
packaging==23.2 packaging==23.2
# via delocate # via
# build
# delocate
platformdirs==4.2.0 platformdirs==4.2.0
# via virtualenv # via virtualenv
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
# via
# build
# pyproject-hooks
typing-extensions==4.10.0 typing-extensions==4.10.0
# via delocate # via delocate
virtualenv==20.25.1 virtualenv==20.25.1
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
wheel==0.42.0 zipp==3.17.0
# via -r cibuildwheel/resources/constraints.in # via importlib-metadata
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
pip==24.0 pip==24.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
setuptools==69.1.1
# via -r cibuildwheel/resources/constraints.in
+1 -2
View File
@@ -1,5 +1,4 @@
pip pip
setuptools build
wheel
delocate delocate
virtualenv virtualenv
+7 -5
View File
@@ -4,6 +4,8 @@
# #
# nox -s update_constraints-3.12 # nox -s update_constraints-3.12
# #
build==1.0.3
# via -r cibuildwheel/resources/constraints.in
delocate==0.10.7 delocate==0.10.7
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
distlib==0.3.8 distlib==0.3.8
@@ -11,18 +13,18 @@ distlib==0.3.8
filelock==3.13.1 filelock==3.13.1
# via virtualenv # via virtualenv
packaging==23.2 packaging==23.2
# via delocate # via
# build
# delocate
platformdirs==4.2.0 platformdirs==4.2.0
# via virtualenv # via virtualenv
pyproject-hooks==1.0.0
# via build
typing-extensions==4.10.0 typing-extensions==4.10.0
# via delocate # via delocate
virtualenv==20.25.1 virtualenv==20.25.1
# via -r cibuildwheel/resources/constraints.in # 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: # The following packages are considered to be unsafe in a requirements file:
pip==24.0 pip==24.0
# via -r cibuildwheel/resources/constraints.in # via -r cibuildwheel/resources/constraints.in
setuptools==69.1.1
# via -r cibuildwheel/resources/constraints.in
+1 -13
View File
@@ -315,17 +315,7 @@ def setup_python(
call("pip", "--version", env=env) call("pip", "--version", env=env)
log.step("Installing build tools...") log.step("Installing build tools...")
if build_frontend == "pip": if build_frontend == "build":
call(
"pip",
"install",
"--upgrade",
"setuptools",
"wheel",
*dependency_constraint_flags,
env=env,
)
elif build_frontend == "build":
call( call(
"pip", "pip",
"install", "install",
@@ -334,8 +324,6 @@ def setup_python(
*dependency_constraint_flags, *dependency_constraint_flags,
env=env, env=env,
) )
else:
assert_never(build_frontend)
if python_libs_base: if python_libs_base:
# Set up the environment for various backends to enable cross-compilation # Set up the environment for various backends to enable cross-compilation
+11 -19
View File
@@ -27,12 +27,10 @@ project_with_expected_version_checks = test_projects.new_c_project(
print('Gathered versions', versions) print('Gathered versions', versions)
for package_name in ['pip', 'setuptools', 'wheel']: expected_version = os.environ['EXPECTED_PIP_VERSION']
env_name = 'EXPECTED_{}_VERSION'.format(package_name.upper())
expected_version = os.environ[env_name]
assert '{}=={}'.format(package_name, expected_version) in versions, ( assert f'pip=={expected_version}' in versions, (
'error: {} version should equal {}'.format(package_name, expected_version) 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)) 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): def test_pinned_versions(tmp_path, python_version, build_frontend_env):
if utils.platform == "linux": if utils.platform == "linux":
pytest.skip("linux doesn't pin individual tool versions, it pins manylinux images instead") 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" constraint_filename = "constraints-python38.txt"
build_pattern = "[cp]p38-*" build_pattern = "[cp]p38-*"
else: else:
constraint_filename = "constraints.txt" constraint_filename = "constraints-python310.txt"
build_pattern = "[cp]p39-*" build_pattern = "[cp]p310-*"
constraint_file = cibuildwheel.util.resources_dir / constraint_filename constraint_file = cibuildwheel.util.resources_dir / constraint_filename
constraint_versions = get_versions_from_constraint_file(constraint_file) constraint_versions = get_versions_from_constraint_file(constraint_file)
for package in ["pip", "setuptools", "wheel", "virtualenv"]: build_environment["EXPECTED_PIP_VERSION"] = constraint_versions["pip"]
env_name = f"EXPECTED_{package.upper()}_VERSION"
build_environment[env_name] = constraint_versions[package]
cibw_environment_option = " ".join(f"{k}={v}" for k, v in build_environment.items()) 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 = [ expected_wheels = [
w for w in utils.expected_wheels("spam", "0.1.0") if "-cp38" in w or "-pp38" in w 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 = [ 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: else:
msg = "unhandled python version" msg = "unhandled python version"
@@ -121,9 +117,7 @@ def test_dependency_constraints_file(tmp_path, build_frontend_env):
tool_versions = { tool_versions = {
"pip": "23.1.2", "pip": "23.1.2",
"setuptools": "67.7.2", "delocate": "0.10.3",
"wheel": "0.38.3",
"virtualenv": "20.23.0",
} }
constraints_file = tmp_path / "constraints file.txt" constraints_file = tmp_path / "constraints file.txt"
@@ -131,9 +125,7 @@ def test_dependency_constraints_file(tmp_path, build_frontend_env):
textwrap.dedent( textwrap.dedent(
""" """
pip=={pip} pip=={pip}
setuptools=={setuptools} delocate=={delocate}
wheel=={wheel}
virtualenv=={virtualenv}
importlib-metadata<3,>=0.12; python_version < "3.8" importlib-metadata<3,>=0.12; python_version < "3.8"
""".format(**tool_versions) """.format(**tool_versions)
) )