Merge pull request #1727 from pypa/dont-require-platform

Don't require `--platform` when running on a development machine
This commit is contained in:
Joe Rickerby
2024-02-28 09:20:25 +00:00
committed by GitHub
5 changed files with 43 additions and 85 deletions
+4 -2
View File
@@ -184,7 +184,7 @@ Options: `auto` `linux` `macos` `windows`
Default: `auto`
`auto` will auto-detect platform using environment variables, such as `TRAVIS_OS_NAME`/`APPVEYOR`/`CIRCLECI`.
`auto` will build wheels for the current platform.
- For `linux`, you need [Docker or Podman](#container-engine) running, on Linux, macOS, or Windows.
- For `macos` and `windows`, you need to be running on the respective system, with a working compiler toolchain installed - Xcode Command Line tools for macOS, and MSVC for Windows.
@@ -192,7 +192,7 @@ Default: `auto`
This option can also be set using the [command-line option](#command-line) `--platform`. This option is not available in the `pyproject.toml` config.
!!! tip
You can use this option to locally debug your cibuildwheel config, instead of pushing to CI to test every change. For example:
You can use this option to locally debug your cibuildwheel config on Linux, instead of pushing to CI to test every change. For example:
```bash
export CIBW_BUILD='cp37-*'
@@ -200,6 +200,8 @@ This option can also be set using the [command-line option](#command-line) `--pl
cibuildwheel --platform linux .
```
Linux builds are the easiest to test locally, because all the build tools are supplied in the container, and they run exactly the same locally as in CI.
This is even more convenient if you store your cibuildwheel config in [`pyproject.toml`](#configuration-file).
You can also run a single identifier with `--only <identifier>`. This will
+10 -41
View File
@@ -11,45 +11,14 @@ locally to quickly iterate and track down issues without even touching CI.
Install cibuildwheel and run a build like this:
!!! tab "Linux"
```sh
# using pipx (https://github.com/pypa/pipx)
pipx run cibuildwheel
Using [pipx](https://github.com/pypa/pipx):
```sh
pipx run cibuildwheel --platform linux
```
Or,
```sh
pip install cibuildwheel
cibuildwheel --platform linux
```
!!! tab "macOS"
Using [pipx](https://github.com/pypa/pipx):
```sh
pipx run cibuildwheel --platform macos
```
Or,
```sh
pip install cibuildwheel
cibuildwheel --platform macos
```
!!! tab "Windows"
Using [pipx](https://github.com/pypa/pipx):
```bat
pipx run cibuildwheel --platform windows
```
Or,
```bat
pip install cibuildwheel
cibuildwheel --platform windows
```
# or,
pip install cibuildwheel
cibuildwheel
```
You should see the builds taking place. You can experiment with options using environment variables or pyproject.toml.
@@ -63,7 +32,7 @@ You should see the builds taking place. You can experiment with options using en
# run a command to set up the build system
export CIBW_BEFORE_ALL='uname -a'
cibuildwheel --platform linux
cibuildwheel
```
> CMD (Windows)
@@ -71,7 +40,7 @@ You should see the builds taking place. You can experiment with options using en
```bat
set CIBW_BEFORE_ALL='uname -a'
cibuildwheel --platform linux
cibuildwheel
```
!!! tab "pyproject.toml"
@@ -88,7 +57,7 @@ You should see the builds taking place. You can experiment with options using en
Then invoke cibuildwheel, like:
```console
cibuildwheel --platform linux
cibuildwheel
```
### Linux builds