Best workflow and practices for releasing a new py

2019-04-29 08:17发布

问题:

I was wondering what is the best procedure or practices for releasing a new python package version on pypi and github.

For example, is this the typical workflow a major python package would follow?

  1. On master branch, increment version number
    1. Set version='1.5.0' in setup.py
    2. Set __version__ = '1.5.0' in package __init__.py
  2. Update CHANGELOG.md with new version
  3. Run tox locally to verify package
  4. Push changes git push origin master
  5. Create tag git tag v1.5.0 -m "Release v1.5.0"
  6. Push tag git push origin v1.5.0
  7. Wait for Travis CI build to finish.
  8. Build package python setup.py sdist bdist_wheel
  9. Verify created packages
    1. test-sdist/bin/pip install dist/<package>-1.5.0.tar.gz
    2. test-wheel/bin/pip install dist/<package>-1.5.0-py2.py3-none-any.whl
  10. Upload to PyPI Staging
    1. twine upload -r testpypi dist/<package>-1.5.0*
    2. pip install --user --no-cache-dir --extra-index-url https://testpypi.python.org/pypi <package>
  11. Upload to PyPI Production
    1. twine upload dist/<package>-1.5.0>*
    2. pip install <package>==1.5.0