panosl / django-currencies

django-currencies allows you to define different currencies, and includes template tags/filters to allow easy conversion between them.
http://pypi.python.org/pypi/django-currencies
BSD 3-Clause "New" or "Revised" License
94 stars 81 forks source link

Remove 'requires' option from setup.py #47

Closed kskumar closed 7 years ago

kskumar commented 7 years ago

When using pip to install the latest master from github, I encounter the following error:

(myvirtualenv) $ pip install -e "git+https://github.com/panosl/django-currencies.git@master#egg=currencies"
Obtaining currencies from git+https://github.com/panosl/django-currencies.git@master#egg=currencies
  Updating /home/user/virtualenvs/myvirtualenv/src/currencies clone (to master)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/user/virtualenvs/myvirtualenv/src/currencies/setup.py", line 95, in <module>
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
      File "/usr/local/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/user/virtualenvs/myvirtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 320, in __init__
        _Distribution.__init__(self, attrs)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 253, in __init__
        getattr(self.metadata, "set_" + key)(val)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 1207, in set_requires
        distutils.versionpredicate.VersionPredicate(v)
      File "/usr/local/lib/python3.6/distutils/versionpredicate.py", line 114, in __init__
        raise ValueError("expected parenthesized list: %r" % paren)
    ValueError: expected parenthesized list: '-jsonfield (>=1.0.3)'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /home/user/virtualenvs/myvirtualenv/src/currencies/

The exact issue appears to be the use of the requires option within setup(). Specifically, setuptools interprets the dash character within the package name django-jsonfield as an arithmetic operator (see https://github.com/v3n0m-Scanner/V3n0M-Scanner/issues/47#issuecomment-241246116).

Since distutils is no longer in use by this package, wouldn't it be safe to remove the requires option from setup()?

panosl commented 7 years ago

This has been fixed by the latest pull request #50