Making your python project pip-installable
Some relevant links
- Official but verbose
- Easy-simple
- Some StackOverflow things
PyPI
PyPI, the Python Package Index, is a repository of Python packages that can be
installed with pip
. You can set up a local PyPI server and configure
pip
to use it by modifying your $HOME/.pypirc
file. It’s easy to set up a
Heroku instance to run pypiserver.
Why bother
If you package Python code this way, two benefits accrue. First, pip will install the executable script right on the path, whenever you are in a virtual environment to which your package has been installed. Second, this configures your package to make it ready and easy to upload to a PyPI server.
Here is my-awesome-helloworld-script
.
To build my package, I need a setup.py
file.
And here is the process for building the package.