From 16e23410b468532e0f86127d9bbb15ca26d50532 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 27 Feb 2020 20:30:02 +0000 Subject: [PATCH] Change twine references to be immediately preceded by the pip install 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 --- README.md | 8 ++++++-- examples/travis-ci-deploy-only.yml | 8 ++++++-- examples/travis-ci-test-and-deploy.yml | 22 +++++++++++++++------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c76cfb54..40b03b74 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ env: # Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings install: - - python3 -m pip install twine cibuildwheel==1.1.0 + - python3 -m pip install cibuildwheel==1.1.0 script: # build the wheels, put them into './wheelhouse' @@ -83,7 +83,11 @@ script: after_success: # if the release was tagged, upload them to PyPI - - if [[ $TRAVIS_TAG ]]; then python3 -m twine upload wheelhouse/*.whl; fi + - | + if [[ $TRAVIS_TAG ]]; then + python3 -m pip install twine + python3 -m twine upload wheelhouse/*.whl + fi ``` For more information, including how to build on Appveyor, Azure, CircleCI, check out the [documentation](https://cibuildwheel.readthedocs.org) and also check out [the examples](https://github.com/joerick/cibuildwheel/tree/master/examples). diff --git a/examples/travis-ci-deploy-only.yml b/examples/travis-ci-deploy-only.yml index c8f9e5aa..1e7e55d5 100644 --- a/examples/travis-ci-deploy-only.yml +++ b/examples/travis-ci-deploy-only.yml @@ -23,7 +23,7 @@ env: # Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings install: - - python3 -m pip install twine cibuildwheel==1.1.0 + - python3 -m pip install cibuildwheel==1.1.0 script: # build the wheels, put them into './wheelhouse' @@ -31,4 +31,8 @@ script: after_success: # if the release was tagged, upload them to PyPI - - if [[ $TRAVIS_TAG ]]; then python3 -m twine upload wheelhouse/*.whl; fi + - | + if [[ $TRAVIS_TAG ]]; then + python3 -m pip install twine + python3 -m twine upload wheelhouse/*.whl + fi diff --git a/examples/travis-ci-test-and-deploy.yml b/examples/travis-ci-test-and-deploy.yml index a7ef48e9..81b206dc 100644 --- a/examples/travis-ci-test-and-deploy.yml +++ b/examples/travis-ci-test-and-deploy.yml @@ -47,30 +47,38 @@ jobs: name: Deploy source distribution install: skip script: python3 setup.py sdist --formats=gztar - after_success: python3 -m twine upload --skip-existing dist/*.tar.gz + 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 twine cibuildwheel==1.1.0 + install: python3 -m pip install cibuildwheel==1.1.0 script: python3 -m cibuildwheel --output-dir wheelhouse - after_success: python3 -m twine upload --skip-existing wheelhouse/*.whl + 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 twine cibuildwheel==1.1.0 + install: python3 -m pip install cibuildwheel==1.1.0 script: python3 -m cibuildwheel --output-dir wheelhouse - after_success: python3 -m twine upload --skip-existing wheelhouse/*.whl + 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 twine cibuildwheel==1.1.0 + install: python3 -m pip install cibuildwheel==1.1.0 script: python3 -m cibuildwheel --output-dir wheelhouse - after_success: python3 -m twine upload --skip-existing wheelhouse/*.whl + after_success: | + python3 -m pip install twine + python3 -m twine upload --skip-existing wheelhouse/*.whl env: global: