As people commonly do, we claim requirements in
When we need a library, just add a line such as
If we need to install library from Git, pip enable us to do that.
pip currently supports cloning over
We can also passing branch names, a commit hash or a tag name as an url anchor:
We must know there are 2 types of installing mode:
- for editable mode, by adding
-eoption, pip will install library by cloning project into a
srcdirectory, which means source code included.
- for non-editable mode, the project is built locally in a temp dir and then installed normally.
-e git+ssh://[email protected]/org/repo.git#egg=repo
Q: How to choose these modes?
A: If you have tagged git commit to a specified version, just use non-editable mode.
Normally, we will append version to egg is used by pip in its dependency logic to identify the project prior to pip downloading and analyzing the metadata. The optional “version” component of the egg name is extremely important if you want to upgrade library in non-editable mode. The format of egg is like