summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2023-05-03 13:52:30 +0100
committerGitHub <noreply@github.com>2023-05-03 13:52:30 +0100
commitb010f52705b41cd904813076447da3092776462a (patch)
treed46a964f8dfc258363da679eaae0d5f952c5ea99
parente94cb204693cee145ea531905dd50b02a26c9f0a (diff)
parent3f172826492e99470db75a74cdaa5494ec3e932c (diff)
downloadpython-setuptools-git-b010f52705b41cd904813076447da3092776462a.tar.gz
Adequate venv fixtures to the latest change in virtualenv for Python 3.12 (#3915)
-rw-r--r--changelog.d/3915.misc.rst1
-rw-r--r--setuptools/tests/fixtures.py4
-rw-r--r--setuptools/tests/test_virtualenv.py4
-rw-r--r--setuptools/version.py4
4 files changed, 8 insertions, 5 deletions
diff --git a/changelog.d/3915.misc.rst b/changelog.d/3915.misc.rst
new file mode 100644
index 00000000..cd962b2c
--- /dev/null
+++ b/changelog.d/3915.misc.rst
@@ -0,0 +1 @@
+Adequate tests to the latest changes in ``virtualenv`` for Python 3.12.
diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py
index 25ab49fd..f1cfc66c 100644
--- a/setuptools/tests/fixtures.py
+++ b/setuptools/tests/fixtures.py
@@ -105,6 +105,8 @@ def venv(tmp_path, setuptools_wheel):
"""Virtual env with the version of setuptools under test installed"""
env = environment.VirtualEnv()
env.root = path.Path(tmp_path / 'venv')
+ env.create_opts = ['--no-setuptools', '--wheel=bundle']
+ # TODO: Use `--no-wheel` when setuptools implements its own bdist_wheel
env.req = str(setuptools_wheel)
# In some environments (eg. downstream distro packaging),
# where tox isn't used to run tests and PYTHONPATH is set to point to
@@ -125,7 +127,7 @@ def venv_without_setuptools(tmp_path):
"""Virtual env without any version of setuptools installed"""
env = environment.VirtualEnv()
env.root = path.Path(tmp_path / 'venv_without_setuptools')
- env.create_opts = ['--no-setuptools']
+ env.create_opts = ['--no-setuptools', '--no-wheel']
env.ensure_env()
return env
diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py
index acfe04e9..b17be9ef 100644
--- a/setuptools/tests/test_virtualenv.py
+++ b/setuptools/tests/test_virtualenv.py
@@ -174,8 +174,8 @@ def _check_test_command_install_requirements(venv, tmpdir):
def test_test_command_install_requirements(venv, tmpdir, tmpdir_cwd):
- # Ensure pip/wheel packages are installed.
- venv.run(["python", "-c", "__import__('pkg_resources').require(['pip', 'wheel'])"])
+ # Ensure pip is installed.
+ venv.run(["python", "-c", "import pip"])
# disable index URL so bits and bobs aren't requested from PyPI
with contexts.environment(PYTHONPATH=None, PIP_NO_INDEX="1"):
_check_test_command_install_requirements(venv, tmpdir)
diff --git a/setuptools/version.py b/setuptools/version.py
index 75b2a149..ec253c41 100644
--- a/setuptools/version.py
+++ b/setuptools/version.py
@@ -1,6 +1,6 @@
from ._importlib import metadata
try:
- __version__ = metadata.version('setuptools')
+ __version__ = metadata.version('setuptools') or '0.dev0+unknown'
except Exception:
- __version__ = 'unknown'
+ __version__ = '0.dev0+unknown'