AcademySoftwareFoundation / AcademySoftwareFoundation/rez

rez-pip cannot install astroid 2.2.0 for Python 3.6

Open
#876 1 comment 0 reactions 0 assignees View on GitHub
bug rez-pip
Dominant language
Python
Stars
1.1k
Forks
374
Avg merge
9d 12h
Merged PRs (30d)
5

Description

I tried installing astroid 2.2.0, which is a dependency of pylint

```
$ rez-pip --install astroid==2.2.0 --python-version=3.6
07:24:47 INFO Trying to use pip from python package
07:24:47 INFO Found pip-20.0.2 inside /home/selecaoone/packages/python/3.6.8/package.py. Will use it with /usr/bin/python3
07:24:47 INFO Installing 'astroid==2.2.0' with pip taken from '/usr/bin/python3'
Collecting astroid==2.2.0
Using cached https://files.pythonhosted.org/packages/31/e9/610c16ecc417c1918915f8f30e54fcfd195788fe450cf8d7d1a061e14628/astroid-2.2.0-py3-none-any.whl
Collecting six (from astroid==2.2.0)
Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting lazy-object-proxy (from astroid==2.2.0)
Using cached https://files.pythonhosted.org/packages/0b/dd/b1e3407e9e6913cf178e506cd0dee818e58694d9a5cd1984e3f6a8b9a10f/lazy_object_proxy-1.4.3-cp36-cp36m-manylinux1_x86_64.whl
Collecting typed-ast<1.3.0; python_version < "3.7" and implementation_name == "cpython" (from astroid==2.2.0)
Using cached https://files.pythonhosted.org/packages/52/6c/57ecbb2ecb80274b7f2b7f95d0937de310aa2e66839d7ae9436881525b23/typed_ast-1.2.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting wrapt (from astroid==2.2.0)
Installing collected packages: six, lazy-object-proxy, typed-ast, wrapt, astroid
Successfully installed astroid-2.2.0 lazy-object-proxy-1.4.3 six-1.14.0 typed-ast-1.2.0 wrapt-1.12.1
WARNING: You are using pip version 19.1.1, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Traceback (most recent call last):
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/metadata.py", line 732, in __init__
self._data = json.loads(data)
File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/selecaoone/rez-python-3.6/bin/rez/rez-pip", line 8, in
sys.exit(run_rez_pip())
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/cli/_entry_points.py", line 187, in run_rez_pip
return run("pip")
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/cli/_main.py", line 152, in run
returncode = run_cmd()
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/cli/_main.py", line 144, in run_cmd
return opts.func(opts, opts.parser, extra_arg_groups)
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/cli/pip.py", line 67, in command
extra_args=opts.extra)
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/pip.py", line 289, in pip_install_package
distributions = list(distribution_path.get_distributions())
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/database.py", line 213, in get_distributions
self._generate_cache()
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/database.py", line 167, in _generate_cache
for dist in self._yield_distributions():
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/database.py", line 148, in _yield_distributions
metadata = Metadata(fileobj=stream, scheme='legacy')
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/metadata.py", line 742, in __init__
scheme=scheme)
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/metadata.py", line 285, in __init__
self.read_file(fileobj)
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/metadata.py", line 383, in read_file
self.set(field, value)
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/metadata.py", line 478, in set
if not scheme.is_valid_constraint_list(value):
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/version.py", line 713, in is_valid_constraint_list
return self.is_valid_matcher('dummy_name (%s)' % s)
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/version.py", line 703, in is_valid_matcher
self.matcher(s)
File "/home/selecaoone/rez-python-3.6/lib/python3.6/site-packages/rez/vendor/distlib/version.py", line 116, in __init__
'%r constraints' % op)
ValueError: '.*' not allowed for '>=' constraints
```

astroid 2.2.0 fails but `rez-pip --install astroid==2.1.0 --python-version=3.6` does work. So there may be some change between astroid version 2.1.0 and 2.2.0 which rez-pip does not currently support.

rez: 2.56.1 (tried with both a Python 3.6 and 2.7 install of Rez both fail with the same error)
python: 3.6 / 2.7
os: CentOS-7.7.1908

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the shown rez-pip command, then inspect rez/pip.py and the traceback paths in rez/vendor/distlib/metadata.py and version.py. Compare the metadata or constraints handled for astroid 2.1.0 and 2.2.0; done means astroid 2.2.0 installs successfully for the reported Python versions without the distlib exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.