From 5450d88cc29bdc380abc3fb967296101935b675d Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Fri, 15 Sep 2023 09:41:20 +0100 Subject: [PATCH 1/3] gh-109414: Add some basic information about venvs in the introduction. --- Doc/library/venv.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst index 2482441d649790..9786aec88d75de 100644 --- a/Doc/library/venv.rst +++ b/Doc/library/venv.rst @@ -30,6 +30,23 @@ When used from within a virtual environment, common installation tools such as `pip`_ will install Python packages into a virtual environment without needing to be told to do so explicitly. +A virtual environment is: + +* Used to contain a specific Python interpreter and software libraries and + binaries which are needed to support a project (library or application). + +* Contained in a directory, conventionally either named ``venv`` or ``.venv`` in + the project directory, or under a container directory for lots of virtual + environments, such as ``~/.virtualenvs``. + +* Not checked into source control systems such as Git, Mercurial etc. + +* Considered as disposable -- it should be simple to delete and recreate it from + scratch. You don't place any project code in the environment + +* Not considered as movable or copyable -- you just create a new environment in + the target location. + See :pep:`405` for more background on Python virtual environments. .. seealso:: From 43a2f95ba51601754952e0b65a2cc8a7ef924000 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Fri, 15 Sep 2023 14:15:12 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Victor Stinner --- Doc/library/venv.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst index 9786aec88d75de..a96da42541f181 100644 --- a/Doc/library/venv.rst +++ b/Doc/library/venv.rst @@ -39,12 +39,12 @@ A virtual environment is: the project directory, or under a container directory for lots of virtual environments, such as ``~/.virtualenvs``. -* Not checked into source control systems such as Git, Mercurial etc. +* Not checked into source control systems such as Git. * Considered as disposable -- it should be simple to delete and recreate it from scratch. You don't place any project code in the environment -* Not considered as movable or copyable -- you just create a new environment in +* Not considered as movable or copyable -- you just recreate the same environment in the target location. See :pep:`405` for more background on Python virtual environments. From 6adcdd1087d94155caf4289613ec02c1a274ba7c Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Fri, 15 Sep 2023 17:09:23 +0100 Subject: [PATCH 3/3] Make additional changes to wording. --- Doc/library/venv.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst index a96da42541f181..18af1d41e4044b 100644 --- a/Doc/library/venv.rst +++ b/Doc/library/venv.rst @@ -30,10 +30,12 @@ When used from within a virtual environment, common installation tools such as `pip`_ will install Python packages into a virtual environment without needing to be told to do so explicitly. -A virtual environment is: +A virtual environment is (amongst other things): * Used to contain a specific Python interpreter and software libraries and - binaries which are needed to support a project (library or application). + binaries which are needed to support a project (library or application). These + are by default isolated from software in other virtual environments and Python + interpreters and libraries installed in the operating system. * Contained in a directory, conventionally either named ``venv`` or ``.venv`` in the project directory, or under a container directory for lots of virtual @@ -44,8 +46,8 @@ A virtual environment is: * Considered as disposable -- it should be simple to delete and recreate it from scratch. You don't place any project code in the environment -* Not considered as movable or copyable -- you just recreate the same environment in - the target location. +* Not considered as movable or copyable -- you just recreate the same + environment in the target location. See :pep:`405` for more background on Python virtual environments.