Skip to content

Instantly share code, notes, and snippets.

@corentinbettiol
Last active April 24, 2020 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corentinbettiol/8aa8c05c6ff2efa955465d2333f45f4f to your computer and use it in GitHub Desktop.
Save corentinbettiol/8aa8c05c6ff2efa955465d2333f45f4f to your computer and use it in GitHub Desktop.

Publish a project to pypi (doc)

Test

  1. Install twine
python3 -m pip install --user --upgrade twine
  1. Generating distribution archives
python3 setup.py sdist bdist_wheel
  1. Check for errors (markdown, ...)
python3 -m twine check dist/*
  1. Publish to test Pypi
twine upload --repository-url https://test.pypi.org/legacy/ dist/*

Publishing to real pypi!

Check pypi.sh :)

Troubleshooting

  • long_description has syntax errors in markup and would not be rendered on PyPI. wheel package version is bad, or wheel isn't installed with pip, and the python-wheel ubuntu package is used instead.

    You need wheel >= 0.31.0 for markdown descriptions
    source

    Solution:

    python3 -m pip install --upgrade wheel
  • ModuleNotFoundError: No module named 'keyring.util.escape'

    The error about No module named 'keyring.util.escape' was fixed in keyrings.alt 3.1, so you either need to upgrade keyrings.alt to 3.1 or later or downgrade keyring to a version that still supplies the util.escape behavior.
    source

    Solution:

    python3 -m pip install --upgrade keyrings.alt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment