Set CIBUILDWHEEL environment variable to 1 during build
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user