Skip to content

Instantly share code, notes, and snippets.

@vimalkvn
Forked from audreyfeldroy/pypi-release-checklist.md
Last active March 4, 2017 12:12
Show Gist options
  • Save vimalkvn/c4c4d9edb34549f059f5 to your computer and use it in GitHub Desktop.
Save vimalkvn/c4c4d9edb34549f059f5 to your computer and use it in GitHub Desktop.
My PyPI Release Checklist

PyPI release checklist

Based on: https://gist.github.com/audreyr/5990987

  1. Update version number in setup.py.

  2. Update version number in package\__init__.py.

  3. Update HISTORY.rst with information on the changes for this version.

  4. Install latest version in development mode

     pip install -e .
    
  5. Test

     python setup.py test
    
  6. Create source distribution and wheels

     # clean previous build environment
     python setup.py clean --all
    
     python setup.py sdist
     python setup.py bdist_wheel
    
  7. Test if the sdist installs

     mktmpenv
     cd project/dist
     pip install project-version.tar.gz
     # test if package works
     deactivate
    
  8. Commit changes

     git add [modified files]
     git commit -m "Release 0.2.5"
    
  9. Upload to PyPI using twine

    Create or update ~/.pypirc

     [distutils]
     index-servers=pypi
    
     [pypi]
     repository = https://upload.pypi.org/legacy/
     username = <username>
     password = <password>
    

    Reference: https://packaging.python.org/distributing/#create-an-account

    Then upload packages using twine to an existing PyPI project

     twine upload dist/project-version.tar.gz
     twine upload dist/project-version.whl
    

    If this is a new package, register package on PyPI. The PKG-INFO file found under package.egg-info can be uploaded to prepopulate the form fields.

    Check PyPI listing to make sure the description and changelog/history displays properly. If not, check rst syntax using

     python setup.py --long-description | rst2html > output.html
    

    or

    http://rst.ninjs.org

  10. Test if package can be installed using pip

    mktmpenv
    pip install package
    # test if package works
    deactivate
    
  11. Tag the last commit

    git tag -a 0.2.5
    
  12. Push changes to Git

    git push
    git push --tags
    
  13. Edit the release notes on Github and draft a new release with a title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment