Build & Publish a Python Package
2024-10-26 19:26:41
Build
Prepare setup.py
An example:
1 | from setuptools import find_packages, setup |
run
1 | python setup.py bdist_wheel sdist |
(optional) to test package locally
1 | pip install . |
Publish
Setup info on test.pypi or pypi if not yet. The API key for publishing can be found there.
check:
1 | twine check dist/* |
publish to test.pypi:
1 | twine upload -r testpypi dist/* |
publish to pypi:
1 | twine upload dist/* |
more detail: https://www.youtube.com/watch?v=5KEObONUkik&t=918s