Skip to content

Commit

Permalink
Don't preinstall setuptools and wheel, remove from constraints
Browse files Browse the repository at this point in the history
Reasons to do this:

- setuptools is no longer the only game in town. When cibuildwheel was created, setuptools was the only way to make wheels. these days, there are many build backends so special casing setuptools doesn't make so much sense
- we don't need to preinstall `wheel` any more, setuptools will do that itself when it needs it.
- projects with pyproject.toml (i.e. the vast majority of projects going forward) don't benefit from the pin anyway, because both `pip` and `build` create an isolated environment to install `build-system.requires` into.
- this makes it easier for end users (such as @webknjaz) to control build-system versions using `PIP_CONSTRAINT`, because there's less potential for a user-specified version to conflict with one of our pins.
  - (long-term, I'd love `build` to [support this directly](pypa/build#292), and then we could have a proper way to keep pyproject.toml dependencies loose and forward-compatible while retaining build determinism. But PIP_CONSTRAINT is the best we have for now. PIP_CONSTRAINT isn't ideal because it affects other things, like the test virtualenv).

This PR also adds a pin for pypa/build. It appears that was missing before, but we should pin it.
  • Loading branch information
joerick committed Jan 20, 2024
1 parent 93542c3 commit 9879937
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 74 deletions.
2 changes: 0 additions & 2 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ def setup_python(
"pip",
"install",
"--upgrade",
"setuptools",
"wheel",
"delocate",
*dependency_constraint_flags,
env=env,
Expand Down
16 changes: 11 additions & 5 deletions cibuildwheel/resources/constraints-python310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,31 @@
#
# 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
# via virtualenv
filelock==3.13.1
# via virtualenv
packaging==23.2
# via delocate
# via
# build
# delocate
platformdirs==4.1.0
# via virtualenv
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
# via
# build
# pyproject-hooks
typing-extensions==4.9.0
# via delocate
virtualenv==20.25.0
# 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==23.3.2
# via -r cibuildwheel/resources/constraints.in
setuptools==69.0.3
# via -r cibuildwheel/resources/constraints.in
12 changes: 7 additions & 5 deletions cibuildwheel/resources/constraints-python311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
#
# 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
# via virtualenv
filelock==3.13.1
# via virtualenv
packaging==23.2
# via delocate
# via
# build
# delocate
platformdirs==4.1.0
# via virtualenv
pyproject-hooks==1.0.0
# via build
typing-extensions==4.9.0
# via delocate
virtualenv==20.25.0
# 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==23.3.2
# via -r cibuildwheel/resources/constraints.in
setuptools==69.0.3
# via -r cibuildwheel/resources/constraints.in
12 changes: 7 additions & 5 deletions cibuildwheel/resources/constraints-python312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
#
# 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
# via virtualenv
filelock==3.13.1
# via virtualenv
packaging==23.2
# via delocate
# via
# build
# delocate
platformdirs==4.1.0
# via virtualenv
pyproject-hooks==1.0.0
# via build
typing-extensions==4.9.0
# via delocate
virtualenv==20.25.0
# 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==23.3.2
# via -r cibuildwheel/resources/constraints.in
setuptools==69.0.3
# via -r cibuildwheel/resources/constraints.in
26 changes: 19 additions & 7 deletions cibuildwheel/resources/constraints-python36.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,47 @@
#
# 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
# importlib-metadata
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
20 changes: 14 additions & 6 deletions cibuildwheel/resources/constraints-python37.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,40 @@
#
# 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
# via virtualenv
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
# importlib-metadata
# platformdirs
virtualenv==20.25.0
# 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==23.3.2
# via -r cibuildwheel/resources/constraints.in
setuptools==68.0.0
# via -r cibuildwheel/resources/constraints.in
20 changes: 15 additions & 5 deletions cibuildwheel/resources/constraints-python38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.0
# via virtualenv
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
# via
# build
# pyproject-hooks
typing-extensions==4.9.0
# via delocate
virtualenv==20.25.0
# 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==23.3.2
# via -r cibuildwheel/resources/constraints.in
setuptools==69.0.3
# via -r cibuildwheel/resources/constraints.in
20 changes: 15 additions & 5 deletions cibuildwheel/resources/constraints-python39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.0
# via virtualenv
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
# via
# build
# pyproject-hooks
typing-extensions==4.9.0
# via delocate
virtualenv==20.25.0
# 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==23.3.2
# via -r cibuildwheel/resources/constraints.in
setuptools==69.0.3
# via -r cibuildwheel/resources/constraints.in
3 changes: 1 addition & 2 deletions cibuildwheel/resources/constraints.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pip
setuptools
wheel
build
delocate
virtualenv
12 changes: 7 additions & 5 deletions cibuildwheel/resources/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
#
# 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
# via virtualenv
filelock==3.13.1
# via virtualenv
packaging==23.2
# via delocate
# via
# build
# delocate
platformdirs==4.1.0
# via virtualenv
pyproject-hooks==1.0.0
# via build
typing-extensions==4.9.0
# via delocate
virtualenv==20.25.0
# 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==23.3.2
# via -r cibuildwheel/resources/constraints.in
setuptools==69.0.3
# via -r cibuildwheel/resources/constraints.in
14 changes: 1 addition & 13 deletions cibuildwheel/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

nox.options.sessions = ["lint", "pylint", "check_manifest", "tests"]

PYTHON_ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
PYTHON_ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

DIR = Path(__file__).parent.resolve()

Expand Down
Loading

0 comments on commit 9879937

Please sign in to comment.