Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.69 KB

File metadata and controls

27 lines (20 loc) · 1.69 KB

Python Packaging Primer

Leveling up from writing ugly scripts to building shareable python libraries.

I strongly recommend the following resources for more details on this process:

Level 0: Ugly scripts

We all start making scripts like this. Basically, taking command entered in the python REPL, and saving them to a file.

Level 1: Modules

Level up to writing pretty scripts that can be imported as modules.

Adding an __init__.py file allows for the creation of hierarchical modules.

We can then install these modules locally by introducing a setup.py file and running pip install -e ..

Level 4: Building a Package

Use python's setuptools to turn your module into an acutal installable artifact: python setup.py sdist

Level 5: Uploading to pypi.org

twine upload --repository-url https://test.pypi.org/legacy/ dist/*