Skip to content

Instantly share code, notes, and snippets.

@nilsnolde
Last active May 20, 2019 14:41
Show Gist options
  • Save nilsnolde/d33497b214fea350a5245370053907ef to your computer and use it in GitHub Desktop.
Save nilsnolde/d33497b214fea350a5245370053907ef to your computer and use it in GitHub Desktop.
Publish PyPI
  1. Change version numbers in __init__.py and setup.py
  2. Run tests: nosetests --with-coverage --cover-erase --cover-package=openrouteservice --cover-html -v
  3. Amend *.rst files if new modules were created
  4. Check if installation works for current Python version via python -m venv .venv' and pip install -e ../openrouteservice-py`
  5. Check if conda installs in new environment Python v.x env: conda install --yes -f openrouteservice-py/requirements.py
  6. Add tag after commit: git tag vX.Y.Z
  7. Build dist and wheel: python setup.py sdist bdist_wheel --universal or python3 setup.py sdist bdist_wheel
  8. Check if PyPI can parse all: python -m twine check dist/*
  9. Upload: twine upload dist/*

Conda:

cd conda
rm -r openrouteservice
conda skeleton pypi openrouteservice [--extra-specs requests]
# Build one dist for each Python version
conda-build --python 2.7 openrouteservice
# Convert all versions to all platforms (currently only 2.7, 3.6, 3.7 work, 21.02.2019)
conda-convert ~/anaconda3/conda-bld/linux-64/openrouteservice-1.1.3-py35_0.tar.bz2 -o ~/anaconda3/conda-bld -p all
# And upload every folder contents
anaconda upload -u nilsnolde --skip ~/anaconda3/conda-bld/**/*.tar.bz2
# Delete all hanging distros
rm /home/nilsnolde/anaconda3/conda-bld/**/*rout*.tar.bz2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment