【发布时间】:2012-08-21 22:16:34
【问题描述】:
我有这个应用程序https://github.com/staticdev/django-crud-utils 需要安装 django-sorting 才能工作。但不能是原来的django-sorting,而是我做的一个fork:https://github.com/staticdev/django-sorting
如何放入setup.py文件中进行打包?
Tks.
【问题讨论】:
我有这个应用程序https://github.com/staticdev/django-crud-utils 需要安装 django-sorting 才能工作。但不能是原来的django-sorting,而是我做的一个fork:https://github.com/staticdev/django-sorting
如何放入setup.py文件中进行打包?
Tks.
【问题讨论】:
将其作为可编辑要求包含在内,并注意您必须明确提及鸡蛋名称:
-e git+https://github.com/staticdev/django-sorting#egg=django-sorting
更多选项见http://www.pip-installer.org/en/latest/requirements.html
【讨论】:
-e git+https://github.com/staticdev/django-sorting.git#django-sorting
【讨论】:
git+ 前缀或git:// 协议。
install_requires=[ 'Django>=1.3.1', 'django-pagination>=1.0.7', '-e git+https://github.com/staticdev/django-sorting#egg=django-sorting' ], 对吗?
pip install --upgrade -e git://github.com/staticdev/django-crud-utils.git#egg=django-crud-utils ... Running setup.py egg_info for package django-crud-utils error in django-crud-utils setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers Complete output from command python setup.py egg_info: error in django-crud-utils setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
编辑您的setup.py 并向dependency_links 添加一个条目:
dependency_links = [
'https://github.com/staticdev/django-sorting/tarball/master#egg=django-sort',
],
虽然你的 install_requires 有类似的东西:
install_requires=[
'Django>=1.3.1',
'django-pagination>=1.0.7',
'django-sort',
],
如果你想使用需求文件,请关注Yuval Adam's advice。
【讨论】:
install_requires=read_file('requirements.txt') 中放入行:-e git+https://github.com/staticdev/django-sorting#egg=django-sorting 时,它给了我同样的错误:error in django-crud-utils setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers =(
install_requires 只接受“package>=version”、“package==version”、“packageinstall_requires 中使用-e例如。
install_requires=['django-sort==123dev'], dependency_links=['https://github.com/staticdev/django-sorting/tarball/master#egg=django-sort-123dev']
Source in /home/static/virtualenvs/prp2/build/django-sort has the version 0.1, which does not match the requirement django-sort==123dev (from django-crud-utils) Source in /home/static/virtualenvs/prp2/build/django-sort has version 0.1 that conflicts with django-sort==123dev (from django-crud-utils)github.com/staticdev/django-crud-utils/blob/master/setup.py