Skip to content

Commit a4cc066

Browse files
committed
Merge branch 'fix-py312-virtualenv' into core_metadata
2 parents 8e9c330 + 3f17282 commit a4cc066

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

changelog.d/3915.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adequate tests to the latest changes in ``virtualenv`` for Python 3.12.

docs/userguide/ext_modules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ To instruct setuptools to compile the ``foo.c`` file into the extension module
4646
4747
.. seealso::
4848
You can find more information on the `Python docs about C/C++ extensions`_.
49-
Alternatively, you might also be interested in learn about `Cython`_.
49+
Alternatively, you might also be interested in learning about `Cython`_.
5050

5151
If you plan to distribute a package that uses extensions across multiple
5252
platforms, :pypi:`cibuildwheel` can also be helpful.

setuptools/tests/fixtures.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ def venv(tmp_path, setuptools_wheel):
105105
"""Virtual env with the version of setuptools under test installed"""
106106
env = environment.VirtualEnv()
107107
env.root = path.Path(tmp_path / 'venv')
108+
env.create_opts = ['--no-setuptools', '--wheel=bundle']
109+
# TODO: Use `--no-wheel` when setuptools implements its own bdist_wheel
108110
env.req = str(setuptools_wheel)
109111
# In some environments (eg. downstream distro packaging),
110112
# 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):
125127
"""Virtual env without any version of setuptools installed"""
126128
env = environment.VirtualEnv()
127129
env.root = path.Path(tmp_path / 'venv_without_setuptools')
128-
env.create_opts = ['--no-setuptools']
130+
env.create_opts = ['--no-setuptools', '--no-wheel']
129131
env.ensure_env()
130132
return env
131133

setuptools/tests/test_virtualenv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ def sdist(distname, version):
174174

175175

176176
def test_test_command_install_requirements(venv, tmpdir, tmpdir_cwd):
177-
# Ensure pip/wheel packages are installed.
178-
venv.run(["python", "-c", "__import__('pkg_resources').require(['pip', 'wheel'])"])
177+
# Ensure pip is installed.
178+
venv.run(["python", "-c", "import pip"])
179179
# disable index URL so bits and bobs aren't requested from PyPI
180180
with contexts.environment(PYTHONPATH=None, PIP_NO_INDEX="1"):
181181
_check_test_command_install_requirements(venv, tmpdir)

setuptools/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from ._importlib import metadata
22

33
try:
4-
__version__ = metadata.version('setuptools')
4+
__version__ = metadata.version('setuptools') or '0.dev0+unknown'
55
except Exception:
6-
__version__ = 'unknown'
6+
__version__ = '0.dev0+unknown'

0 commit comments

Comments
 (0)