Tests fail in my environment and I do not know why
Hi, I am trying to run tests for setuptools 50.3.2 for openSUSE Tumbleweed (so most packages are in their newest version) and I am getting the following error:
[ 228s] ==================================== ERRORS ====================================
[ 228s] ___________________ ERROR at setup of test_distutils_stdlib ____________________
[ 228s]
[ 228s] tmpdir = local('/tmp/pytest-of-abuild/pytest-0/test_distutils_stdlib0')
[ 228s]
[ 228s] @pytest.fixture
[ 228s] def venv(tmpdir):
[ 228s] env = VirtualEnv()
[ 228s] env.root = path.Path(tmpdir)
[ 228s] env.req = os.getcwd()
[ 228s] > return env.create()
[ 228s]
[ 228s] setuptools/tests/test_distutils_adoption.py:28:
[ 228s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 228s] /usr/lib/python3.8/site-packages/jaraco/envs.py:24: in create
[ 228s] self.install()
[ 228s] /usr/lib/python3.8/site-packages/jaraco/envs.py:39: in install
[ 228s] subprocess.check_call(cmd, env=env)
[ 228s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 228s]
[ 228s] popenargs = ([Path('/tmp/pytest-of-abuild/pytest-0/test_distutils_stdlib0/.env/bin/python'), '-m', 'pip', 'install', '/home/abuild/rpmbuild/BUILD/setuptools-50.3.2'],)
[ 228s] kwargs = {'env': {'COLORTERM': '1', 'CPU': 'i686', 'CSHEDIT': 'emacs', 'FORCE_SOURCE_DATE': '1', ...}}
[ 228s] retcode = 1
[ 228s] cmd = [Path('/tmp/pytest-of-abuild/pytest-0/test_distutils_stdlib0/.env/bin/python'), '-m', 'pip', 'install', '/home/abuild/rpmbuild/BUILD/setuptools-50.3.2']
[ 228s]
[ 228s] def check_call(*popenargs, **kwargs):
[ 228s] """Run command with arguments. Wait for command to complete. If
[ 228s] the exit code was zero then return, otherwise raise
[ 228s] CalledProcessError. The CalledProcessError object will have the
[ 228s] return code in the returncode attribute.
[ 228s]
[ 228s] The arguments are the same as for the call function. Example:
[ 228s]
[ 228s] check_call(["ls", "-l"])
[ 228s] """
[ 228s] retcode = call(*popenargs, **kwargs)
[ 228s] if retcode:
[ 228s] cmd = kwargs.get("args")
[ 228s] if cmd is None:
[ 228s] cmd = popenargs[0]
[ 228s] > raise CalledProcessError(retcode, cmd)
[ 228s] E subprocess.CalledProcessError: Command '[Path('/tmp/pytest-of-abuild/pytest-0/test_distutils_stdlib0/.env/bin/python'), '-m', 'pip', 'install', '/home/abuild/rpmbuild/BUILD/setuptools-50.3.2']' returned non-zero exit status 1.
[ 228s]
[ 228s] /usr/lib/python3.8/subprocess.py:364: CalledProcessError
[ 228s] ---------------------------- Captured stdout setup -----------------------------
[ 228s] created virtual environment CPython3.8.6.final.0-32 in 621ms
[ 228s] creator CPython3Posix(dest=/tmp/pytest-of-abuild/pytest-0/test_distutils_stdlib0/.env, clear=False, no_vcs_ignore=False, global=False)
[ 228s] seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/abuild/.local/share/virtualenv)
[ 228s] added seed packages: pip==20.2.4, setuptools==50.3.2, wheel==0.35.1
[ 228s] activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
[ 228s] Processing /home/abuild/rpmbuild/BUILD/setuptools-50.3.2
[ 228s] ---------------------------- Captured stderr setup -----------------------------
[ 228s] ERROR: Command errored out with exit status 1:
[ 228s] command: /tmp/pytest-of-abuild/pytest-0/test_distutils_stdlib0/.env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-88lzyc3r/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-88lzyc3r/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-q_w7m9tn
[ 228s] cwd: /tmp/pip-req-build-88lzyc3r/
[ 228s] Complete output (9 lines):
[ 228s] Traceback (most recent call last):
[ 228s] File "<string>", line 1, in <module>
[ 228s] File "/tmp/pip-req-build-88lzyc3r/setuptools/__init__.py", line 16, in <module>
[ 228s] import setuptools.version
[ 228s] File "/tmp/pip-req-build-88lzyc3r/setuptools/version.py", line 1, in <module>
[ 228s] import pkg_resources
[ 228s] File "/tmp/pip-req-build-88lzyc3r/pkg_resources/__init__.py", line 73, in <module>
[ 228s] import appdirs
[ 228s] ModuleNotFoundError: No module named 'appdirs'
[ 228s] ----------------------------------------
[ 228s] ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
In fact, this error pops out for all three tests in test_distutils_adoption.py. It looks like there is some problem with the venv fixture defined there. Appdirs 1.4.4 is installed in my environment, but I have a suspicion your virtual environment does not pull it.
Is there a bug in any involved package (setuptools, jaraco.envs, virtualenv) or is my config just wrong? You can see my package on https://build.opensuse.org/package/show/home:mcalabkova:branches:devel:languages:python/python-setuptools . Thanks a lot!
(.env) abuild@stitny:/tmp/pytest-of-abuild/pytest-0/test_distutils_local0/.env/bin> ./python3
Python 3.8.6 (default, Nov 09 2020, 12:09:06) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import appdirs
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'appdirs'
>>>
(.env) abuild@stitny:/tmp/pytest-of-abuild/pytest-0/test_distutils_local0/.env/bin> rpm -ql python3-appdirs
/usr/lib/python3.8/site-packages/__pycache__/appdirs.cpython-38.opt-1.pyc
/usr/lib/python3.8/site-packages/__pycache__/appdirs.cpython-38.pyc
/usr/lib/python3.8/site-packages/appdirs-1.4.4-py3.8.egg-info
/usr/lib/python3.8/site-packages/appdirs-1.4.4-py3.8.egg-info/PKG-INFO
/usr/lib/python3.8/site-packages/appdirs-1.4.4-py3.8.egg-info/SOURCES.txt
/usr/lib/python3.8/site-packages/appdirs-1.4.4-py3.8.egg-info/dependency_links.txt
/usr/lib/python3.8/site-packages/appdirs-1.4.4-py3.8.egg-info/top_level.txt
/usr/lib/python3.8/site-packages/appdirs.py
/usr/share/doc/packages/python3-appdirs
/usr/share/doc/packages/python3-appdirs/CHANGES.rst
/usr/share/doc/packages/python3-appdirs/README.rst
/usr/share/licenses/python3-appdirs
/usr/share/licenses/python3-appdirs/LICENSE.txt
(.env) abuild@stitny:/tmp/pytest-of-abuild/pytest-0/test_distutils_local0/.env/bin> ./python3
Python 3.8.6 (default, Nov 09 2020, 12:09:06) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python38.zip', '/usr/lib64/python3.8', '/usr/lib64/python3.8/lib-dynload', '/tmp/pytest-of-abuild/pytest-0/test_distutils_local0/.env/lib64/python3.8/site-packages', '/tmp/pytest-of-abuild/pytest-0/test_distutils_local0/.env/lib/python3.8/site-packages']
>>>
(i.e., we are missing /usr/lib/python3.8 in the list)
Something is wrong with our patch F00102-lib64.patch or perhaps F00251-change-user-install-location.patch. Are these still needed?
I think, this is obsolete.
pkg_resources is also no longer used by setuptools
Ok let's close this issue as stale for now, but the author can re-open it with new information if necessary or create a new issue.