This is a no nonsense guide to making your Python project installable via pip.
You can check the Github repository for my project little-mallet-wrapper for an example of how to package your project.
Organize your project so that its file structure looks like this:
LICENSE
should contain a copy of the license text you’ve chosen for your project.
README.md
should contain a description of your project and documentation of usage.
__init__.py
should import all of the functions that you want to expose to your users.
For example, here is the __init__.py
file for little-mallet-wrapper:
setup.py
should include all the specifications for your project.
For example, here is the setup.py
file for little-mallet-wrapper:
Create an account on PyPI.
Install and/or update setuptools and wheel:
python3 -m pip install --user --upgrade setuptools wheel
Install and/or update twine:
python3 -m pip install --user --upgrade twine
Generate your distribution files:
python3 setup.py sdist bdist_wheel
Upload to PyPI:
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
These resources have much more detailed information.
Marche 25, 2020