Publishing a Package to PyPI
To publish your library on https://pypi.org:
- Add the required metadata files.
- Build source and wheel distributions.
- Upload with
twine
.
Required files
setup.py
1 | from setuptools import setup, find_packages |
README
Provide usage instructions in Markdown or reStructuredText.
LICENSE
Pick an open-source license; https://choosealicense.com/ helps if you are unsure.
Optional helpers include MANIFEST.in
and setup.cfg
for finer control.
Build the distributions
1 | pip install wheel |
Upload
- Register: https://pypi.org/account/register/
- Install twine:
pip install twine
- Upload:
twine upload dist/*
Reference: