Repository: rucio/rucio

Issue:
pip install rucio fails with newer versions of pip
Apparently newer versions of pip don't like the three equals in the cx_oracle dependency. (Somewhere along the line internally it sticks parentheses around the version description, and then the parser chokes on that combination).

```
(rucio-test) [illingwo@fermicloud014 rucio-test]$ pip --version
pip 18.0 from /cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip (python 2.7)
(rucio-test) [illingwo@fermicloud014 rucio-test]$ pip install rucio
Collecting rucio
Exception:
Traceback (most recent call last):
  File "/cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip/_internal/basecommand.py", line 141, in main
    status = self.run(options, args)
  File "/cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 299, in run
    resolver.resolve(requirement_set)
  File "/cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip/_internal/resolve.py", line 306, in _resolve_one
    set(req_to_install.extras) - set(dist.extras)
  File "/cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2826, in extras
    return [dep for dep in self._dep_map if dep]
  File "/cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2871, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2881, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in parse_requirements
    yield Requirement(line)
  File "/cloud/login/illingwo/rucio-test/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2951, in __init__
    raise RequirementParseError(str(e))
RequirementParseError: Invalid requirement, parse error at "'(===6.3.'"
```




Discussion:
I think this is just a typo. I don't think there is a `===` verison operator in setuptools. 
Which version of setuptools are you using?
Setuptools 40.0.0, although the failure doesn't involve setuptools at all. There is actually a triple equals operator, but I'm not sure if it's expected to work in this context or not (see https://www.python.org/dev/peps/pep-0440/#arbitrary-equality) 


Yes, I just saw, the operator is not directly described in setuptools but apparently has been patched in in version 8.0. I cannot re-produce this on my machine, neither with 40.0 nor with 36.8.0 which we use on our machines.
It works with pip 8.1.2 that comes with RH 7, but I'm not sure it's patched - more that the older version of pip is simpler.

You should be able to reproduce with a virtualenv:
```
[illingwo@fermicloud014 ~]$ python -mvirtualenv testdir
New python executable in /cloud/login/illingwo/testdir/bin/python
[illingwo@fermicloud014 testdir]$ . bin/activate
(testdir) [illingwo@fermicloud014 testdir]$ pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-18.0
(testdir) [illingwo@fermicloud014 testdir]$ pip install rucio
Collecting rucio
Exception:
Traceback (most recent call last):
  File "/cloud/login/illingwo/testdir/lib/python2.7/site-packages/pip/_internal/basecommand.py", line 141, in main
    status = self.run(options, args)
  File "/cloud/login/illingwo/testdir/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 299, in run
    resolver.resolve(requirement_set)
  File "/cloud/login/illingwo/testdir/lib/python2.7/site-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/cloud/login/illingwo/testdir/lib/python2.7/site-packages/pip/_internal/resolve.py", line 306, in _resolve_one
    set(req_to_install.extras) - set(dist.extras)
  File "/cloud/login/illingwo/testdir/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2826, in extras
    return [dep for dep in self._dep_map if dep]
  File "/cloud/login/illingwo/testdir/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2871, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/cloud/login/illingwo/testdir/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2881, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/cloud/login/illingwo/testdir/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in parse_requirements
    yield Requirement(line)
  File "/cloud/login/illingwo/testdir/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2951, in __init__
    raise RequirementParseError(str(e))
RequirementParseError: Invalid requirement, parse error at "'(===6.3.'"
```

Confirmed. ✅ related to pkg_ressources in the pip version.
I think we can change the === to a == that should be sufficient to fix this, since we do not need that strict comparison anyway.

Resolving patch:
diff --git a/setup_rucio.py b/setup_rucio.py
--- a/setup_rucio.py
+++ b/setup_rucio.py
@@ -15,7 +15,7 @@
 # Authors:
 # - Mario Lassnig <mario.lassnig@cern.ch>, 2012-2014
 # - Vincent Garonne <vgaronne@gmail.com>, 2012-2018
-# - Martin Barisits <martin.barisits@cern.ch>, 2012-2017
+# - Martin Barisits <martin.barisits@cern.ch>, 2012-2018
 # - Wen Guan <wguan.icedew@gmail.com>, 2014
 # - Thomas Beermann <thomas.beermann@cern.ch>, 2014-2018
 
@@ -164,7 +164,7 @@ def write_requirements():
         req_file.close()
 
 
-oracle_extras = ['cx_oracle===6.3.1']
+oracle_extras = ['cx_oracle==6.3.1']
 postgresql_extras = ['psycopg2>=2.4.2']
 mysql_extras = ['PyMySQL']
 kerberos_extras = ['kerberos>=1.3.0', 'pykerberos>=1.2.1', 'requests-kerberos>=0.12.0']


Test patch: