Code Monkey home page Code Monkey logo

cibuildwheel-autopypi-example's Introduction

cibuildwheel auto-deploy to PyPI example

Travis setup

  • Add an env section to your .travis.yml

    env:
      global:
        - TWINE_USERNAME=...your pypi username...
        # Note: TWINE_PASSWORD is set in Travis settings
    

    And add an upload step to the script section

    script:
      - pip install cibuildwheel==x.x.x
      - cibuildwheel --output-dir wheelhouse
      - |
        if [[ $TRAVIS_TAG ]]; then
          python -m pip install twine
          python -m twine upload wheelhouse/*.whl
        fi
    

    Check this repo's .travis.yml as an example.

  • In the Travis web UI, go to your project settings and add the environment variable TWINE_PASSWORD, set to your PyPI password.

Appveyor setup

  • Add this env to your appveyor.yml

    environment:
      TWINE_USERNAME: ...your pypi username...
      # Note: TWINE_PASSWORD is set in Appveyor settings
    

    Add this upload step to the build_script:

    build_script:
      - pip install cibuildwheel==x.x.x
      - cibuildwheel --output-dir wheelhouse
      - >
        IF "%APPVEYOR_REPO_TAG%" == "true"
        (
        python -m pip install twine
        &&
        python -m twine upload wheelhouse/*.whl
        )
    

    Check this repo's appveyor.yml as an example.

  • In the Appveyor UI, add your PyPI password as TWINE_PASSWORD (click Settings > Environment > Add Variable...). Make sure to mark it as private!

On each release

  • Bump the version number in setup.py and anywhere else it occurs (I use bumpversion for this)
  • Commit these changes, tag that commit, and push to Github (don't forget to push the tag! git push --tags). Your wheels will start building.
  • Locally, build a source distribution with rm -rf dist && python setup.py sdist
  • Upload the source distribution using twine upload dist/*.tar.gz

Your wheels will build in Travis/Appveyor and push to PyPI when ready.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.