Specifying GitHub Direct Sources in Requirements.txt
Directly installing libraries from GitHub repositories via commands like pip install git git://github.com/mozilla/elasticutils.git can be convenient, but how can you specify these dependencies in your requirements.txt file?
The Standard Requirements.txt Syntax
Requirements.txt files typically follow a straightforward format:
package-one==1.9.4 package-two==3.7.1 package-three==1.0.1
However, these entries do not have the package name-version format that is required for direct GitHub repo installations.
Specifying GitHub Repositories in Requirements.txt
To specify a GitHub repository, you do not need the package-name== convention. Instead, follow these guidelines:
Additional Considerations
Example
Update package-two from a GitHub repository in your requirements.txt as follows:
package-two @ git+https://github.com/owner/repo@main
The above is the detailed content of How to Specify GitHub Direct Sources in Requirements.txt?. For more information, please follow other related articles on the PHP Chinese website!