You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running pip's tests, it still imports from distutils directly. I'd like to work on a PR that will remove or conditionalize this dependency.
To check, I've used Python 3.11 with distutils removed.
First, I get:
$ nox -e test-3.11
ImportError while loading conftest '/home/churchyard/Dokumenty/pypa/pip/tests/conftest.py'.
tests/conftest.py:41: in <module>
from tests.lib import DATA_DIR, SRC_DIR, PipTestEnvironment, TestData
tests/lib/__init__.py:42: in <module>
from tests.lib.venv import VirtualEnvironment
tests/lib/venv.py:11: in <module>
import virtualenv as _virtualenv
.nox/test-3-11/lib/python3.11/site-packages/virtualenv.py:24: in <module>
import distutils.spawn
E ModuleNotFoundError: No module named 'distutils'
Then I upgrade virtualenv, edit tests/requirements.txt, and skip some tests due to #8273
$ pytest_k='not test_from_link_vcs_with_source_dir_obtains_commit_id and not test_from_link_vcs_without_source_dir and not test_should_cache_git_sha'
$ nox -e test-3.11 -- -k "$pytest_k" --deselect tests/functional --deselect tests/lib/test_lib.py --deselect tests/unit/test_build_env.py
...
==================================== ERRORS ====================================
______________ ERROR collecting tests/functional/test_install.py _______________
ImportError while importing test module '.../pypa/pip/tests/functional/test_install.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/functional/test_install.py:1: in <module>
import distutils
E ModuleNotFoundError: No module named 'distutils'
___________ ERROR collecting tests/functional/test_install_wheel.py ____________
ImportError while importing test module '.../pypa/pip/tests/functional/test_install_wheel.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/functional/test_install_wheel.py:3: in <module>
import distutils
E ModuleNotFoundError: No module named 'distutils'
I'd like to avoid the imports entirely, even though the 2 test files probably cannot run with the new virtualenv anyway (yet).
The tests still don't run without distutils
because they require virtualenv < 20 (and virtualenv 16 uses distutils),
but at least they don't import distutils directly now.
Fixespypa#11521
hroncok
added a commit
to hroncok/pip
that referenced
this issue
Oct 17, 2022
The tests still don't run without distutils
because they require virtualenv < 20 (and virtualenv 16 uses distutils),
but at least they don't import distutils directly now.
Fixespypa#11521
Description
When running pip's tests, it still imports from distutils directly. I'd like to work on a PR that will remove or conditionalize this dependency.
To check, I've used Python 3.11 with distutils removed.
First, I get:
Then I upgrade virtualenv, edit tests/requirements.txt, and skip some tests due to #8273
I'd like to avoid the imports entirely, even though the 2 test files probably cannot run with the new virtualenv anyway (yet).
Expected behavior
Tests still run on Python without distutils.
pip version
main
Python version
3.11.0rc2 sans distuils
OS
Fedora Linux
How to Reproduce
See the description.
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: