summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorPradyun Gedam <pradyunsg@gmail.com>2023-04-18 04:43:34 (GMT)
committerGitHub <noreply@github.com>2023-04-18 04:43:34 (GMT)
commitece20dba120a1a4745721c49f8d7389d4b1ee2a7 (patch)
treebcf21108159d242e4067f4ef9a1304d7f10a7f8a /Doc
parentf39e00f9521a0d412a5fc9a50f2a553ec2bb1a7c (diff)
downloadcpython-ece20dba120a1a4745721c49f8d7389d4b1ee2a7.zip
cpython-ece20dba120a1a4745721c49f8d7389d4b1ee2a7.tar.gz
cpython-ece20dba120a1a4745721c49f8d7389d4b1ee2a7.tar.bz2
gh-95299: Stop installing setuptools as a part of ensurepip and venv (#101039)
Remove the bundled setuptools wheel from ensurepip, and stop installing setuptools in environments created by venv. Co-Authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/venv.rst7
-rw-r--r--Doc/using/venv-create.inc7
-rw-r--r--Doc/whatsnew/3.12.rst18
3 files changed, 28 insertions, 4 deletions
diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst
index 240ab13..52bf99e 100644
--- a/Doc/library/venv.rst
+++ b/Doc/library/venv.rst
@@ -284,11 +284,14 @@ creation according to their needs, the :class:`EnvBuilder` class.
.. method:: upgrade_dependencies(context)
- Upgrades the core venv dependency packages (currently ``pip`` and
- ``setuptools``) in the environment. This is done by shelling out to the
+ Upgrades the core venv dependency packages (currently ``pip``)
+ in the environment. This is done by shelling out to the
``pip`` executable in the environment.
.. versionadded:: 3.9
+ .. versionchanged:: 3.12
+
+ ``setuptools`` is no longer a core venv dependency.
.. method:: post_setup(context)
diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc
index 43ee6b7..2fc9012 100644
--- a/Doc/using/venv-create.inc
+++ b/Doc/using/venv-create.inc
@@ -61,12 +61,16 @@ The command, if run with ``-h``, will show the available options::
environment (pip is bootstrapped by default)
--prompt PROMPT Provides an alternative prompt prefix for this
environment.
- --upgrade-deps Upgrade core dependencies: pip setuptools to the
+ --upgrade-deps Upgrade core dependencies (pip) to the
latest version in PyPI
Once an environment has been created, you may wish to activate it, e.g. by
sourcing an activate script in its bin directory.
+.. versionchanged:: 3.12
+
+ ``setuptools`` is no longer a core venv dependency.
+
.. versionchanged:: 3.9
Add ``--upgrade-deps`` option to upgrade pip + setuptools to the latest on PyPI
@@ -104,4 +108,3 @@ invoked to bootstrap ``pip`` into the virtual environment.
Multiple paths can be given to ``venv``, in which case an identical virtual
environment will be created, according to the given options, at each provided
path.
-
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index 2a371eb..bd95bfe 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -731,6 +731,24 @@ Removed
project can be installed: it still provides ``distutils``.
(Contributed by Victor Stinner in :gh:`92584`.)
+* Remove the bundled setuptools wheel from :mod:`ensurepip`,
+ and stop installing setuptools in environments created by :mod:`venv`.
+
+ ``pip (>= 22.1)`` does not require setuptools to be installed in the
+ environment. ``setuptools``-based (and ``distutils``-based) packages
+ can still be used with ``pip install``, since pip will provide
+ ``setuptools`` in the build environment it uses for building a
+ package.
+
+ ``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils``
+ are no longer provided by default in environments created with
+ ``venv`` or bootstrapped with ``ensurepip``, since they are part of
+ the ``setuptools`` package. For projects relying on these at runtime,
+ the ``setuptools`` project should be declared as a dependency and
+ installed separately (typically, using pip).
+
+ (Contributed by Pradyun Gedam in :gh:`95299`.)
+
* Removed many old deprecated :mod:`unittest` features:
- A number of :class:`~unittest.TestCase` method aliases: