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?
- On
masterbranch, incrementversionnumber- Set
version='1.5.0'insetup.py - Set
__version__ = '1.5.0'in package__init__.py
- Set
- Update
CHANGELOG.mdwith new version - Run
toxlocally to verify package - Push changes
git push origin master - Create tag
git tag v1.5.0 -m "Release v1.5.0" - Push tag
git push origin v1.5.0 - Wait for
Travis CIbuild to finish. - Build package
python setup.py sdist bdist_wheel - Verify created packages
test-sdist/bin/pip install dist/<package>-1.5.0.tar.gztest-wheel/bin/pip install dist/<package>-1.5.0-py2.py3-none-any.whl
- Upload to
PyPI Stagingtwine upload -r testpypi dist/<package>-1.5.0*pip install --user --no-cache-dir --extra-index-url https://testpypi.python.org/pypi <package>
- Upload to
PyPI Productiontwine upload dist/<package>-1.5.0>*pip install <package>==1.5.0
来源:https://stackoverflow.com/questions/53122766/best-workflow-and-practices-for-releasing-a-new-python-package-version-on-github