AcademySoftwareFoundation / AcademySoftwareFoundation/rez

rez-pip sphinx install fail

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

Description

rez-pip -i sphinx
04:55:24 INFO Using pip-9.0.1 (/home/jlgerber/packages/pip/9.0.1/package.py[0])
/home/jlgerber/packages/pip/9.0.1/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python-2.7/python/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
cmdoptions.check_install_build_global(options)
Collecting sphinx
Downloading Sphinx-1.5.3.tar.gz (4.4MB)
100% |████████████████████████████████| 4.4MB 262kB/s
Requirement already satisfied: six>=1.5 in ./packages/python/2.7.5/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python/extra (from sphinx)
Requirement already satisfied: Jinja2>=2.3 in ./packages/python/2.7.5/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python/extra (from sphinx)
Collecting Pygments>=2.0 (from sphinx)
Downloading Pygments-2.2.0.tar.gz (2.1MB)
100% |████████████████████████████████| 2.1MB 429kB/s
Collecting docutils>=0.11 (from sphinx)
Downloading docutils-0.13.1.tar.gz (1.7MB)
100% |████████████████████████████████| 1.7MB 406kB/s
Collecting snowballstemmer>=1.1 (from sphinx)
Downloading snowballstemmer-1.2.1.tar.gz (49kB)
100% |████████████████████████████████| 51kB 799kB/s
Collecting babel!=2.0,>=1.3 (from sphinx)
Downloading Babel-2.4.0.tar.gz (6.6MB)
100% |████████████████████████████████| 6.6MB 208kB/s
Collecting alabaster<0.8,>=0.7 (from sphinx)
Downloading alabaster-0.7.10.tar.gz
Collecting imagesize (from sphinx)
Downloading imagesize-0.7.1.tar.gz
Requirement already satisfied: requests>=2.0.0 in ./packages/python/2.7.5/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python/extra (from sphinx)
Requirement already satisfied: markupsafe in /usr/lib64/python2.7/site-packages (from Jinja2>=2.3->sphinx)
Collecting pytz>=0a (from babel!=2.0,>=1.3->sphinx)
Downloading pytz-2017.2.zip (502kB)
100% |████████████████████████████████| 512kB 1.0MB/s
Installing collected packages: Pygments, docutils, snowballstemmer, pytz, babel, alabaster, imagesize, sphinx
Running setup.py install for Pygments ... done
Running setup.py install for docutils ... done
Running setup.py install for snowballstemmer ... done
Found existing installation: pytz 2012d
DEPRECATION: Uninstalling a distutils installed project (pytz) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling pytz-2012d:
Successfully uninstalled pytz-2012d
Running setup.py install for pytz ... done
Found existing installation: Babel 0.9.6
Uninstalling Babel-0.9.6:
Successfully uninstalled Babel-0.9.6
Running setup.py install for babel ... done
Running setup.py install for alabaster ... done
Running setup.py install for imagesize ... done
Running setup.py install for sphinx ... done
Successfully installed Pygments alabaster babel-0.9.6 docutils imagesize pytz-2012d snowballstemmer sphinx
04:55:44 DEBUG Found /tmp/pip-SKUYl_-rez/rez_staging/python/Babel-2.4.0-py2.7.egg-info
04:55:44 DEBUG Found /tmp/pip-SKUYl_-rez/rez_staging/python/Pygments-2.2.0-py2.7.egg-info
04:55:44 DEBUG Found /tmp/pip-SKUYl_-rez/rez_staging/python/Sphinx-1.5.3-py2.7.egg-info
04:55:44 WARNING Not recognised as a requirement: u''
04:55:44 WARNING Unexpected line: quitting requirement scan: u'[test]'
04:55:44 DEBUG Found /tmp/pip-SKUYl_-rez/rez_staging/python/alabaster-0.7.10-py2.7.egg-info
04:55:44 DEBUG Found /tmp/pip-SKUYl_-rez/rez_staging/python/docutils-0.13.1-py2.7.egg-info
04:55:44 DEBUG Found /tmp/pip-SKUYl_-rez/rez_staging/python/imagesize-0.7.1-py2.7.egg-info
04:55:44 DEBUG Found /tmp/pip-SKUYl_-rez/rez_staging/python/pytz-2017.2-py2.7.egg-info
04:55:44 DEBUG Found /tmp/pip-SKUYl_-rez/rez_staging/python/snowballstemmer-1.2.1-py2.7.egg-info
Traceback (most recent call last):
File "/opt/rez-2.12.0/bin/rez/rez-pip", line 4, in
run('pip')
File "/opt/rez-2.12.0/lib/python2.7/site-packages/rez-2.12.0-py2.7.egg/rez/cli/_main.py", line 118, in run
returncode = run_cmd()
File "/opt/rez-2.12.0/lib/python2.7/site-packages/rez-2.12.0-py2.7.egg/rez/cli/_main.py", line 110, in run_cmd
return opts.func(opts, opts.parser, arg_groups[1:])
File "/opt/rez-2.12.0/lib/python2.7/site-packages/rez-2.12.0-py2.7.egg/rez/cli/pip.py", line 46, in command
release=opts.release)
File "/opt/rez-2.12.0/lib/python2.7/site-packages/rez-2.12.0-py2.7.egg/rez/pip.py", line 262, in pip_install_package
requirements.extend(_get_dependencies(requirement, distributions))
File "/opt/rez-2.12.0/lib/python2.7/site-packages/rez-2.12.0-py2.7.egg/rez/pip.py", line 74, in _get_dependencies
name = get_distrubution_name(name)
File "/opt/rez-2.12.0/lib/python2.7/site-packages/rez-2.12.0-py2.7.egg/rez/pip.py", line 47, in get_distrubution_name
pip_to_rez_name = pip_name.lower().replace("-", "_")
AttributeError: 'NoneType' object has no attribute 'lower

I tried running it again and got a different error:

rez-pip -i sphinx
05:06:07 INFO Using pip-9.0.1 (/home/jlgerber/packages/pip/9.0.1/package.py[0])
/home/jlgerber/packages/pip/9.0.1/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python-2.7/python/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
cmdoptions.check_install_build_global(options)
Collecting sphinx
Using cached Sphinx-1.5.3.tar.gz
Requirement already satisfied: six>=1.5 in ./packages/python/2.7.5/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python/extra (from sphinx)
Requirement already satisfied: Jinja2>=2.3 in ./packages/python/2.7.5/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python/extra (from sphinx)
Collecting Pygments>=2.0 (from sphinx)
Using cached Pygments-2.2.0.tar.gz
Collecting docutils>=0.11 (from sphinx)
Using cached docutils-0.13.1.tar.gz
Collecting snowballstemmer>=1.1 (from sphinx)
Using cached snowballstemmer-1.2.1.tar.gz
Collecting babel!=2.0,>=1.3 (from sphinx)
Using cached Babel-2.4.0.tar.gz
Collecting alabaster<0.8,>=0.7 (from sphinx)
Using cached alabaster-0.7.10.tar.gz
Collecting imagesize (from sphinx)
Using cached imagesize-0.7.1.tar.gz
Requirement already satisfied: requests>=2.0.0 in ./packages/python/2.7.5/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python/extra (from sphinx)
Requirement already satisfied: markupsafe in /usr/lib64/python2.7/site-packages (from Jinja2>=2.3->sphinx)
Collecting pytz>=0a (from babel!=2.0,>=1.3->sphinx)
Using cached pytz-2017.2.zip
Installing collected packages: Pygments, docutils, snowballstemmer, pytz, babel, alabaster, imagesize, sphinx
Running setup.py install for Pygments ... done
Running setup.py install for docutils ... done
Running setup.py install for snowballstemmer ... done
Found existing installation: pytz 2012d
DEPRECATION: Uninstalling a distutils installed project (pytz) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling pytz-2012d:
Exception:
Traceback (most recent call last):
File "/home/jlgerber/packages/pip/9.0.1/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python-2.7/python/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/jlgerber/packages/pip/9.0.1/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python-2.7/python/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/jlgerber/packages/pip/9.0.1/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python-2.7/python/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/home/jlgerber/packages/pip/9.0.1/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python-2.7/python/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/home/jlgerber/packages/pip/9.0.1/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python-2.7/python/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/home/jlgerber/packages/pip/9.0.1/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python-2.7/python/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/home/jlgerber/packages/python/2.7.5/platform-linux/arch-x86_64/os-CentOS-7.3.1611/python/lib/shutil.py", line 302, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/pytz-2012d-py2.7.egg-info'
05:06:14 ERROR BuildError: Failed to download source with pip: pip install --install-option=--install-lib=/tmp/pip-PDrhDo-rez/rez_staging/python --install-option=--install-scripts=/tmp/pip-PDrhDo-rez/rez_staging/bin --install-option=--install-headers=/tmp/pip-PDrhDo-rez/rez_staging/include --install-option=--install-data=/tmp/pip-PDrhDo-rez/rez_staging sphinx

Is it trying to uninstall pytz?

Contributor guide

Open the contributing guide

Research direction

Reproduce `rez-pip -i sphinx`, then inspect `rez/cli/pip.py` and `rez/pip.py`, especially `_get_dependencies` and `get_distrubution_name`, using the traceback as the entry point. Check how the pip install command handles the existing system `pytz` installation and its permission error. Done means the failure is handled correctly and the command no longer crashes while processing the dependency metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.