Specific GIT app as PIP package install requiremen

2019-02-16 19:12发布

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.

3条回答
三岁会撩人
2楼-- · 2019-02-16 19:27
-e git+https://github.com/staticdev/django-sorting.git#django-sorting
查看更多
该账号已被封号
3楼-- · 2019-02-16 19:41

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

查看更多
▲ chillily
4楼-- · 2019-02-16 19:44

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.

查看更多
登录 后发表回答