When it comes to packages probably every Python developer thinks of pypi. This is the most common way of distribution them in the ecosystem.
But there are several cases where packages are in a progress or pre alfa state in which a package maintaner considers a release is too early. Or in other cases packages are only ment to be used internally. One solution is to install such packages is via git.
Please be aware that the strings used after
pip install can be used directly inside the
Install via SSH
This is usefull for projects located inside an internal git server or for projects that are not public and require ssh authentication.
pip install git+ssh://email@example.com/<owner>/<project>
pip install git+ssh://[email protected]/nezhar/django-model-prefix
Install via HTTPS
Probably the most common use case is testing new features in open source repositories and installing modules that are not released on pypi.
pip install git+https://git.tld/<owner>/<project>
pip install git+https://github.com/nezhar/django-model-prefix
Installing a branch, tag or commit
The above commands will only install what is available in the default branch. In most of the cases you want to target a
specific branch, tag or maybe even a commit. This can be achieved by providing
@ argument to the git string.
pip install git+https://github.com/nezhar/[email protected]
Providing options for
Some packages provide
setup.cfg. In order to target them during the
installation process, the
#egg argument must be provided. As a value in contains the name of the package and the option for the
pip install git+https://github.com/anexia-it/[email protected]#egg=jsonschema[format]