Specific GIT app as PIP package install requiremen

2019-02-16 19:15发布

问题:

I have this app https://github.com/staticdev/django-crud-utils that need to have django-sorting installed to work. But it can't be the original django-sorting, but a fork I made: https://github.com/staticdev/django-sorting

How do I put it in the setup.py file for packaging?

Tks.

回答1:

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

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

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



回答2:

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

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

While 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 Yuval Adam's advice.



回答3:

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