Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: allow local runs on windows/macOS #974

Merged
merged 3 commits into from Jan 8, 2022
Merged

Conversation

mayeut
Copy link
Member

@mayeut mayeut commented Dec 28, 2021

  • Cache python installations to a user cache folder using platformdirs.
  • The build environment is now a virtual environment to allow proper isolation.
  • Allows to run tests in parallel.

Specific for macOS:
The python.org installers are still installed globally, only one {major}.{minor} is allowed to be installed at a time.
The way this is handled does not change with this PR meaning that there might be a mismatch between the installed python version and the one expected by cibuildwheel.
Given shudoers right are necessary to do the installation, in order for local runs to work, the user still has to install the relevant python versions manually.

Edit by joerick: Fixes #104

@mayeut mayeut force-pushed the python-cache3 branch 3 times, most recently from 15dde4a to 583d5f7 Compare December 28, 2021 22:51
Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far! I would have thought that creating a virtualenv for every build would have made the macos/windows builds much slower, but it seems that the concurrency makes up for it!

cibuildwheel/util.py Show resolved Hide resolved
cibuildwheel/macos.py Show resolved Hide resolved
cibuildwheel/macos.py Outdated Show resolved Hide resolved
cibuildwheel/windows.py Outdated Show resolved Hide resolved
cibuildwheel/__main__.py Outdated Show resolved Hide resolved
@mayeut mayeut force-pushed the python-cache3 branch 6 times, most recently from 61380e6 to 3c6d509 Compare January 5, 2022 02:01
Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant work on this @mayeut !

cibuildwheel/macos.py Show resolved Hide resolved
cibuildwheel/macos.py Outdated Show resolved Hide resolved
cibuildwheel/util.py Show resolved Hide resolved
cibuildwheel/util.py Outdated Show resolved Hide resolved
cibuildwheel/util.py Show resolved Hide resolved
cibuildwheel/windows.py Outdated Show resolved Hide resolved
cibuildwheel/windows.py Outdated Show resolved Hide resolved
Cache python installations to a user cache folder using platformdirs.
The build environment is now a virtual environment to allow proper isolation.
Allows to run tests in parallel.
Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for working on this @mayeut, it's a big improvement for usability.

I also pushed some docs updates. Feel free to edit those if you like.

@mayeut
Copy link
Member Author

mayeut commented Jan 8, 2022

I also pushed some docs updates. Feel free to edit those if you like.

That looks good thanks.

@mayeut mayeut merged commit ab13f7a into pypa:main Jan 8, 2022
@mayeut mayeut deleted the python-cache3 branch January 8, 2022 10:37
joerick added a commit that referenced this pull request Jan 21, 2024
Historically, we required `--platform` when running cibuildwheel outside of CI, because cibuildwheel would attempt to globally install Python interpreters and some packages.

That was fixed in #974 a couple of years ago. As a result, there's no reason to require --platform these days, the `auto` behaviour is perfectly fine for dev machines.

It also makes running tests locally simpler, one can just do `pytest test/test_0_basic.py` (or `nox -s tests -- test/test_0_basic.py`) and not have to worry about setting CIBW_PLATFORM most of the time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optionally use existing installations of tools
3 participants