Release new version of Python lib to PyPI
November 27, 2021 ยท View on GitHub
git log --pretty=format:"- %s%n%b" --since="$(git show -s --format=%ad `git rev-list --tags --max-count=1`)" | pbcopy
-
Edit the changelog
-
Commit
-
Push to PyPi configure twine to upload to pypi and testpypi
git clean -dfX
tox -e build
# push to testPyPi
python3 -m twine upload --repository testpypi dist/*
# check if it works
python3 -m pip install --index-url https://test.pypi.org/simple/ gspread
# push to PyPi
python3 -m twine upload --repository pypi dist/*
- Tag in Git and push to remote
export RELEASE_NUM=`sed -En "s/__version__ = '([^']+)'/\1/p" gspread/__init__.py`
git tag v$RELEASE_NUM -m "Tagging release v$RELEASE_NUM"
git push --tags
-
Select 'Draft new release'
-
Choose the latest tag
-
put title: 'Release vX.Y.Z
-
copy notes from HISTORY.rst file
-
paste it in release description
-
Hit "Publish release"
-
Rebuild docs: https://readthedocs.org/projects/gspread/