我正在编写一个可重用的 Django 应用程序,如下所述: https ://django.readthedocs.org/en/1.5.x/intro/reusable-apps.html
当我在 setup.py 中指定包名称中包含破折号的要求时,setup.py 将不会运行。例如,如果我的 setup.py 包含这一行:
requires=[ 'djangotinymce', 'MtFileUtil', 'Django', 'PyYAML', ],
然后它可以正常工作。
python ./setup.py sdist
running sdist
...
Creating tar archive
如果我将行更改为如下所示:
requires=[ 'django-tinymce', 'MtFileUtil', 'Django', 'PyYAML', ],
我们得到一个奇怪的错误
Traceback (most recent call last):
File "./setup.py", line 32, in <module>
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "/home/travis/venv/deleteme/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 259, in __init__
getattr(self.metadata, "set_" + key)(val)
File "/usr/lib/python2.7/distutils/dist.py", line 1220, in set_requires
distutils.versionpredicate.VersionPredicate(v)
File "/usr/lib/python2.7/distutils/versionpredicate.py", line 113, in __init__
raise ValueError("expected parenthesized list: %r" % paren)
ValueError: expected parenthesized list: '-tinymce'
我不确定该怎么做。我想要求 django-tinymce 但我不知道该怎么做。