-
Notifications
You must be signed in to change notification settings - Fork 5
Developer notes
Uche edited this page Jul 8, 2016
·
20 revisions
You need Github & PyPI update access.
You should also have pypandoc installed, if possible. On Debian-ish systems:
sudo apt-get install pandoc
#pandoc is Python 2.x only, so switch to a py2 VM, then:
pip install pypandoc
Actually at present, until pandoc supports Python 3 we have to generate an RST README by hand and then paste it into setup.py, as discussed below.
#Update README.md
vi README.md
#Generate RST from MD
pandoc -t rst README.md > /tmp/README.rst
#Next copy the contents of /tmp/README.rst into the LONGDESC constant in setup.py
#Upload to PyPI Test
python setup.py sdist upload -r pypitest
Now check the updated package page. For example if you're seeing raw RST description rather than HTML, it might be a link whitelist issue. Once it looks all good, proceed to the real release.
First issue a pull request on GitHub to merge develop branch to master, then:
#Switch to master
git checkout master
#Upload to PyPI
python setup.py sdist upload -r pypi
#Select tag name, update according to released version
#Tag release
git tag -a $RELEASETAG -m "Release of version $RELEASETAG" #Must be double, not single quotes
#Push the tag to Github
git push origin $RELEASETAG
#Hmm how about git push --tags origin master ?
Note: if you make a mistake tagging you can undo it using:
git tag -d $RELEASETAG
git push origin ":refs/tags/$RELEASETAG"
Finally switch back to develop branch
git checkout develop
#Bump version for next release
vi lib/version.py
Assumes you've set up index-servers in ~/.pypirc akin to:
# Tells distutils what package indexes you can push to
[distutils]
index-servers =
pypi
pypitest
# authentication details for live PyPI
[pypi]
repository: https://pypi.python.org/pypi
username: {{your_username}}
password: {{your_password}}
# authentication details for test PyPI
[pypitest]
repository: https://testpypi.python.org/pypi
username: {{your_username}}
password: {{your_password}}