pip icon indicating copy to clipboard operation
pip copied to clipboard

there is something wrong with tox in pip

Open zhuofeng6 opened this issue 3 years ago • 2 comments

Description

i count the coverage of the code with tox, because my pip version=21.3.1, but found it is something wrong with this functional.

Expected behavior

No response

pip version

21.3.1

Python version

3.9.9

OS

openeuer-22.03

How to Reproduce

tox -e coverage

Output

[root@localhost pip]# tox -e coverage
GLOB sdist-make: /root/pip/setup.py
coverage inst-nodeps: /root/pip/.tox/.tmp/package/2/pip-21.3.1.zip
coverage installed: attrs==22.1.0,cffi==1.15.1,coverage==6.4.3,cryptography==37.0.4,execnet==1.9.0,freezegun==1.2.1,iniconfig==1.1.1,MarkupSafe==2.1.1,packaging==21.3,pip @ file:///root/pip/.tox/.tmp/package/2/pip-21.3.1.zip,pluggy==1.0.0,py==1.11.0,pycparser==2.21,pyparsing==3.0.9,pytest==7.1.2,pytest-cov==3.0.0,pytest-forked==1.4.0,pytest-rerunfailures==10.2,pytest-xdist==2.5.0,python-dateutil==2.8.2,scripttest==1.3,setuptools==63.1.0,six==1.16.0,tomli==2.0.1,tomli_w==1.0.0,virtualenv==16.7.12,Werkzeug==2.2.2,wheel==0.37.1
coverage run-test-pre: PYTHONHASHSEED='765602858'
coverage run-test-pre: commands[0] | python -c 'import shutil, sys; shutil.rmtree(sys.argv[1], ignore_errors=True)' /root/pip/tests/data/common_wheels
coverage run-test-pre: commands[1] | python /root/pip/tools/tox_pip.py wheel -w /root/pip/tests/data/common_wheels -r /root/pip/tests/requirements-common_wheels.txt
Collecting setuptools>=40.8.0
  Using cached setuptools-64.0.1-py3-none-any.whl (1.2 MB)
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting coverage>=4.4
  Using cached coverage-6.4.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (212 kB)
Saved ./tests/data/common_wheels/wheel-0.37.1-py2.py3-none-any.whl
Saved ./tests/data/common_wheels/coverage-6.4.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved ./tests/data/common_wheels/setuptools-64.0.1-py3-none-any.whl

[notice] A new release of pip available: 21.3.1 -> 22.2.2
[notice] To update, run: pip install --upgrade pip
coverage run-test: commands[0] | python -c 'import os, sys; os.path.exists(sys.argv[1]) or os.mkdir(sys.argv[1])' /root/pip/.coverage-output
coverage run-test: commands[1] | pytest --cov=pip --cov-config=/root/pip/setup.cfg
ImportError while loading conftest '/root/pip/tests/conftest.py'.
tests/conftest.py:24: in <module>
    from setuptools.wheel import Wheel
.tox/coverage/lib/python3.9/site-packages/setuptools/__init__.py:8: in <module>
    import _distutils_hack.override  # noqa: F401
.tox/coverage/lib/python3.9/site-packages/_distutils_hack/override.py:1: in <module>
    __import__('_distutils_hack').do_override()
.tox/coverage/lib/python3.9/site-packages/_distutils_hack/__init__.py:77: in do_override
    ensure_local_distutils()
.tox/coverage/lib/python3.9/site-packages/_distutils_hack/__init__.py:64: in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
E   AssertionError: /usr/lib64/python3.9/distutils/core.py
ERROR: InvocationError for command /root/pip/.tox/coverage/bin/pytest --cov=pip --cov-config=/root/pip/setup.cfg (exited with code 4)
______________________________________________________ summary _______________________________________________________
ERROR:   coverage: commands failed

Code of Conduct

zhuofeng6 avatar Aug 12 '22 09:08 zhuofeng6

my environment is broken?

zhuofeng6 avatar Aug 12 '22 09:08 zhuofeng6

Likely it is your environment / Python installation being broken in some way. Is there some reason you're using an almost-an-year-old version of pip, and trying to run tests on it?

pradyunsg avatar Aug 12 '22 10:08 pradyunsg

i know pip was used with nox replace tox now, but i want to know if there is some bug with tox in the lower pip, will you still support it

zhuofeng6 avatar Aug 13 '22 02:08 zhuofeng6

We generally don't support older pips, and certainly not the developer-facing processes for them. Please use the latest version of pip and the documented ways of running tests.

pfmoore avatar Aug 13 '22 08:08 pfmoore