diff --git a/changelog.d/3915.misc.rst b/changelog.d/3915.misc.rst new file mode 100644 index 00000000000..cd962b2c6e4 --- /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/docs/userguide/ext_modules.rst b/docs/userguide/ext_modules.rst index a59599b2756..8c193856ac2 100644 --- a/docs/userguide/ext_modules.rst +++ b/docs/userguide/ext_modules.rst @@ -46,7 +46,7 @@ To instruct setuptools to compile the ``foo.c`` file into the extension module .. seealso:: You can find more information on the `Python docs about C/C++ extensions`_. - Alternatively, you might also be interested in learn about `Cython`_. + Alternatively, you might also be interested in learning about `Cython`_. If you plan to distribute a package that uses extensions across multiple platforms, :pypi:`cibuildwheel` can also be helpful. diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py index 25ab49fd227..f1cfc66c81e 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 acfe04e9ddb..b17be9ef2ba 100644 --- a/setuptools/tests/test_virtualenv.py +++ b/setuptools/tests/test_virtualenv.py @@ -174,8 +174,8 @@ def sdist(distname, version): 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 75b2a14959a..ec253c41447 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'