Set CIBUILDWHEEL environment variable to 1 during build

This commit is contained in:
mayeut
2017-08-29 18:18:40 +02:00
parent 9faa8f8728
commit 0a7a1b8fb3
4 changed files with 22 additions and 0 deletions
+11
View File
@@ -31,6 +31,17 @@ Usage
`cibuildwheel` is not intended to run on your development machine. It will try to install packages globally; this is no good. Travis CI and Appveyor run their builds in isolated environments, so are ideal for this kind of script.
`cibuildwheel` defines the environment variable `CIBUILDWHEEL` to the value `1` allowing projects for which the C extension is optional to make it mandatory when building wheels.
An easy way to do it in Python 3 is through the `optional` named argument of `Extension` constructor in your `setup.py`:
```python
myextension = Extension(
"myextension",
["myextension.c"],
optional=os.environ.get('CIBUILDWHEEL', '0') != '1',
)
```
### Minimal setup
- Create a `.travis.yml` file in your repo.