line This ensures that the python that installs is the same python that should execute the module (this sometimes isn't true on macOS because the python.org installs that cibuildwheel makes take precedence over the system versions) Fix #266
87 lines
2.7 KiB
YAML
87 lines
2.7 KiB
YAML
# In this configuration, the package is tested against multiple versions of python
|
|
# on Linux and on one version of Python on Windows. If and only if all tests pass
|
|
# will the wheels be built and deployed. Further, deployment is only initiated if
|
|
# the current branch is "master", the current commit is tagged, and the current
|
|
# repo is yours (e.g. it won't run on a Pull Request). For convenience, a source
|
|
# distribution is also created.
|
|
|
|
language: python
|
|
python:
|
|
- 3.5
|
|
- 3.6
|
|
- 3.7
|
|
- 3.8
|
|
|
|
before_install:
|
|
- |
|
|
if [[ "$TRAVIS_OS_NAME" = windows ]]; then
|
|
choco install python --version 3.8.0
|
|
export PATH="/c/Python38:/c/Python38/Scripts:$PATH"
|
|
fi
|
|
|
|
install:
|
|
- python3 -m pip install pytest
|
|
|
|
script:
|
|
- python3 setup.py install
|
|
- pytest
|
|
|
|
stages:
|
|
- test
|
|
# Only execute deployment stage on tagged commits, and from your repository
|
|
# (e.g. not PRs). Replace with your repo name.
|
|
- name: deploy
|
|
if: tag IS PRESENT AND repo = joerick/cibuildwheel
|
|
# To only build tags that look like vX.Y.Z:
|
|
# if: tag =~ ^v\d+\.\d+\.\d+$ AND repo = joerick/cibuildwheel
|
|
|
|
jobs:
|
|
include:
|
|
# Optional: run a test on Windows
|
|
- os: windows
|
|
language: shell
|
|
name: Test on Windows
|
|
|
|
# Deploy source distribution
|
|
- stage: deploy
|
|
name: Deploy source distribution
|
|
install: skip
|
|
script: python3 setup.py sdist --formats=gztar
|
|
after_success: |
|
|
python3 -m pip install twine
|
|
python3 -m twine upload --skip-existing dist/*.tar.gz
|
|
# Deploy on linux
|
|
- stage: deploy
|
|
name: Build and deploy Linux wheels
|
|
services: docker
|
|
install: python3 -m pip install cibuildwheel==1.1.0
|
|
script: python3 -m cibuildwheel --output-dir wheelhouse
|
|
after_success: |
|
|
python3 -m pip install twine
|
|
python3 -m twine upload --skip-existing wheelhouse/*.whl
|
|
# Deploy on mac
|
|
- stage: deploy
|
|
name: Build and deploy macOS wheels
|
|
os: osx
|
|
language: shell
|
|
install: python3 -m pip install cibuildwheel==1.1.0
|
|
script: python3 -m cibuildwheel --output-dir wheelhouse
|
|
after_success: |
|
|
python3 -m pip install twine
|
|
python3 -m twine upload --skip-existing wheelhouse/*.whl
|
|
# Deploy on windows
|
|
- stage: deploy
|
|
name: Build and deploy Windows wheels
|
|
os: windows
|
|
language: shell
|
|
install: python3 -m pip install cibuildwheel==1.1.0
|
|
script: python3 -m cibuildwheel --output-dir wheelhouse
|
|
after_success: |
|
|
python3 -m pip install twine
|
|
python3 -m twine upload --skip-existing wheelhouse/*.whl
|
|
|
|
env:
|
|
global:
|
|
- TWINE_USERNAME=__token__
|
|
# Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings
|