A specific GIT application as a requirement for installing a PIP package

I have this app https://github.com/staticdev/django-crud-utils for which django sorting should be set. But it may not be the original django sort, but the fork I made: https://github.com/staticdev/django-sorting

How to put it in setup.py file for packaging?

Tks.

+8
git django pip packaging
source share
3 answers

Include it as an editable requirement and note that you must explicitly specify the name of the egg:

-e git+https://github.com/staticdev/django-sorting#egg=django-sorting 

For more options, see http://www.pip-installer.org/en/latest/requirements.html

+8
source share

Modify your setup.py and add an entry to dependency_links :

 dependency_links = [ 'https://github.com/staticdev/django-sorting/tarball/master#egg=django-sort', ], 

So far, your install_requires has something like:

 install_requires=[ 'Django>=1.3.1', 'django-pagination>=1.0.7', 'django-sort', ], 

If you want to use requirements files, follow the recommendations of Yuval Adam .

+6
source share
 -e git+https://github.com/staticdev/django-sorting.git#django-sorting 
+1
source share

All Articles