Environment
Red job: https://travis-ci.com/github/pypa/pip/jobs/379292143
Green job: https://travis-ci.com/github/pypa/pip/jobs/379138473
Both are run against 0b18e21, the only different (I believe) is the setuptools version they fetch.
Description
After setuptools 50.0, the test environment fails to populate on PyPy. This is the relevent Tox log:
Attempting uninstall: setuptools
Found existing installation: setuptools 28.8.0
Uninstalling setuptools-28.8.0:
Successfully uninstalled setuptools-28.8.0
Running setup.py install for cffi: started
Running setup.py install for cffi: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /home/travis/build/pypa/pip/.tox/pypy/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qr7zj_2u/cffi_84f0e538f77b4b2d8960cd13ea04fefb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qr7zj_2u/cffi_84f0e538f77b4b2d8960cd13ea04fefb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4lh__icz/install-record.txt --single-version-externally-managed --compile --install-headers /home/travis/build/pypa/pip/.tox/pypy/include/site/python3.5/cffi
cwd: /tmp/pip-install-qr7zj_2u/cffi_84f0e538f77b4b2d8960cd13ea04fefb/
Complete output (58 lines):
'import site' failed
/home/travis/build/pypa/pip/.tox/pypy/site-packages/setuptools/version.py:1: UserWarning: Module _cffi_backend was already imported from None, but /tmp/pip-install-qr7zj_2u/cffi_84f0e538f77b4b2d8960cd13ea04fefb is being added to sys.path
import pkg_resources
Traceback (most recent call last):
File "/opt/python/pypy3.5-7.0.0/lib-python/3/sysconfig.py", line 160, in _subst_vars
return s.format(**local_vars)
KeyError: 'userbase'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/python/pypy3.5-7.0.0/lib-python/3/sysconfig.py", line 163, in _subst_vars
return s.format(**os.environ)
KeyError: 'userbase'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-qr7zj_2u/cffi_84f0e538f77b4b2d8960cd13ea04fefb/setup.py", line 263, in <module>
'License :: OSI Approved :: MIT License',
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/setuptools/_distutils/core.py", line 134, in setup
ok = dist.parse_command_line()
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/setuptools/_distutils/dist.py", line 484, in parse_command_line
args = self._parse_command_opts(parser, args)
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/setuptools/dist.py", line 903, in _parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/setuptools/_distutils/dist.py", line 540, in _parse_command_opts
cmd_class = self.get_command_class(command)
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/setuptools/dist.py", line 742, in get_command_class
self.cmdclass[command] = cmdclass = ep.load()
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/pkg_resources/__init__.py", line 2447, in load
return self.resolve()
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/pkg_resources/__init__.py", line 2453, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/setuptools/command/install.py", line 6, in <module>
import distutils.command.install as orig
File "/home/travis/build/pypa/pip/.tox/pypy/site-packages/setuptools/_distutils/command/install.py", line 18, in <module>
from site import USER_BASE
File "/opt/python/pypy3.5-7.0.0/lib-python/3/site.py", line 574, in <module>
main()
File "/opt/python/pypy3.5-7.0.0/lib-python/3/site.py", line 560, in main
known_paths = addusersitepackages(known_paths)
File "/opt/python/pypy3.5-7.0.0/lib-python/3/site.py", line 283, in addusersitepackages
user_site = getusersitepackages()
File "/opt/python/pypy3.5-7.0.0/lib-python/3/site.py", line 272, in getusersitepackages
USER_SITE = get_path('purelib', '%s_user' % os.name)
File "/opt/python/pypy3.5-7.0.0/lib-python/3/sysconfig.py", line 514, in get_path
return get_paths(scheme, vars, expand)[name]
File "/opt/python/pypy3.5-7.0.0/lib-python/3/sysconfig.py", line 504, in get_paths
return _expand_vars(scheme, vars)
File "/opt/python/pypy3.5-7.0.0/lib-python/3/sysconfig.py", line 184, in _expand_vars
res[key] = os.path.normpath(_subst_vars(value, vars))
File "/opt/python/pypy3.5-7.0.0/lib-python/3/sysconfig.py", line 165, in _subst_vars
raise AttributeError('{%s}' % var)
AttributeError: {'userbase'}
----------------------------------------
ERROR: Command errored out with exit status 1: /home/travis/build/pypa/pip/.tox/pypy/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qr7zj_2u/cffi_84f0e538f77b4b2d8960cd13ea04fefb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qr7zj_2u/cffi_84f0e538f77b4b2d8960cd13ea04fefb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4lh__icz/install-record.txt --single-version-externally-managed --compile --install-headers /home/travis/build/pypa/pip/.tox/pypy/include/site/python3.5/cffi Check the logs for full command output.
Traceback (most recent call last):
File "tools/tox_pip.py", line 31, in <module>
pip(sys.argv[1:])
File "tools/tox_pip.py", line 27, in pip
subprocess.check_call([sys.executable, '-m', 'pip'] + args)
File "/opt/python/pypy3.5-7.0.0/lib-python/3/subprocess.py", line 271, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/travis/build/pypa/pip/.tox/pypy/bin/python', '-m', 'pip', 'install', '-r/home/travis/build/pypa/pip/tools/requirements/tests.txt']' returned non-zero exit status 1
Expected behavior
The test environment should be populated correctly.
Hmm... setuptools' issue tracker doesn't look great.
Why don't force install setuptools < 50 until it is fixed?
We're back to green after setuptools 50.1.0 release. :)
https://setuptools.readthedocs.io/en/latest/history.html#v50-1-0
I am not entirely sure it is best to close and shove this under the rug. At least one of the breakages induced by setuptools 50.0 is already confirmed as a pip bug, and there very well may be more. pip needs a detailed (if not complete) accessment to its setuptools compatibiliy and fix the compatibility issues so the world does not break again when the distutils switch eventually happens.
Agreed -- I don't mean to shove this under the rug. I was filing an issue for "preparedness for $thing" (while struggling to figure out a good name for $thing) and a diplomatically saying we need to be prepared for this + the standard library removal. :)
At least one of the breakages induced by setuptools 50.0 is already confirmed as a pip bug
May I have the pointer to this? Admittedly the number of tickets opened due to setuptools 50.0.0 scared me and I muted most of the relevant discussion :disappointed:
I believe it鈥檚 a variant of #8214
You said it better than I could phrase it @uranusjr. Plus, I can hide behind "I didn't say that" too. :)
Filed #8851 for the follow up discussion.
Thanks for the pointer. I'm not sure what I can do about it, but I was curious.
Most helpful comment
Hmm... setuptools' issue tracker doesn't look great.