Skip to content

Commit c976d78

Browse files
docs: improve venv docs (#124540)
- Move "versionchanged" notes that apply to the whole class to the end of the class docs - Remove or move notes next to the method list that apply to individual methods. - Mark up parameters using the appropriate syntax - Do not capitalize "boolean" - Shorten some text
1 parent fae5058 commit c976d78

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

Doc/library/venv.rst

+25-28
Original file line numberDiff line numberDiff line change
@@ -288,31 +288,31 @@ creation according to their needs, the :class:`EnvBuilder` class.
288288
The :class:`EnvBuilder` class accepts the following keyword arguments on
289289
instantiation:
290290

291-
* ``system_site_packages`` -- a Boolean value indicating that the system Python
291+
* *system_site_packages* -- a boolean value indicating that the system Python
292292
site-packages should be available to the environment (defaults to ``False``).
293293

294-
* ``clear`` -- a Boolean value which, if true, will delete the contents of
294+
* *clear* -- a boolean value which, if true, will delete the contents of
295295
any existing target directory, before creating the environment.
296296

297-
* ``symlinks`` -- a Boolean value indicating whether to attempt to symlink the
297+
* *symlinks* -- a boolean value indicating whether to attempt to symlink the
298298
Python binary rather than copying.
299299

300-
* ``upgrade`` -- a Boolean value which, if true, will upgrade an existing
300+
* *upgrade* -- a boolean value which, if true, will upgrade an existing
301301
environment with the running Python - for use when that Python has been
302302
upgraded in-place (defaults to ``False``).
303303

304-
* ``with_pip`` -- a Boolean value which, if true, ensures pip is
304+
* *with_pip* -- a boolean value which, if true, ensures pip is
305305
installed in the virtual environment. This uses :mod:`ensurepip` with
306306
the ``--default-pip`` option.
307307

308-
* ``prompt`` -- a String to be used after virtual environment is activated
308+
* *prompt* -- a string to be used after virtual environment is activated
309309
(defaults to ``None`` which means directory name of the environment would
310310
be used). If the special string ``"."`` is provided, the basename of the
311311
current directory is used as the prompt.
312312

313-
* ``upgrade_deps`` -- Update the base venv modules to the latest on PyPI
313+
* *upgrade_deps* -- Update the base venv modules to the latest on PyPI
314314

315-
* ``scm_ignore_files`` -- Create ignore files based for the specified source
315+
* *scm_ignore_files* -- Create ignore files based for the specified source
316316
control managers (SCM) in the iterable. Support is defined by having a
317317
method named ``create_{scm}_ignore_file``. The only value supported by
318318
default is ``"git"`` via :meth:`create_git_ignore_file`.
@@ -330,10 +330,7 @@ creation according to their needs, the :class:`EnvBuilder` class.
330330
.. versionchanged:: 3.13
331331
Added the ``scm_ignore_files`` parameter
332332

333-
Creators of third-party virtual environment tools will be free to use the
334-
provided :class:`EnvBuilder` class as a base class.
335-
336-
The returned env-builder is an object which has a method, ``create``:
333+
:class:`EnvBuilder` may be used as a base class.
337334

338335
.. method:: create(env_dir)
339336

@@ -433,37 +430,27 @@ creation according to their needs, the :class:`EnvBuilder` class.
433430

434431
.. method:: upgrade_dependencies(context)
435432

436-
Upgrades the core venv dependency packages (currently ``pip``)
433+
Upgrades the core venv dependency packages (currently :pypi:`pip`)
437434
in the environment. This is done by shelling out to the
438435
``pip`` executable in the environment.
439436

440437
.. versionadded:: 3.9
441438
.. versionchanged:: 3.12
442439

443-
``setuptools`` is no longer a core venv dependency.
440+
:pypi:`setuptools` is no longer a core venv dependency.
444441

445442
.. method:: post_setup(context)
446443

447444
A placeholder method which can be overridden in third party
448445
implementations to pre-install packages in the virtual environment or
449446
perform other post-creation steps.
450447

451-
.. versionchanged:: 3.7.2
452-
Windows now uses redirector scripts for ``python[w].exe`` instead of
453-
copying the actual binaries. In 3.7.2 only :meth:`setup_python` does
454-
nothing unless running from a build in the source tree.
455-
456-
.. versionchanged:: 3.7.3
457-
Windows copies the redirector scripts as part of :meth:`setup_python`
458-
instead of :meth:`setup_scripts`. This was not the case in 3.7.2.
459-
When using symlinks, the original executables will be linked.
460-
461-
In addition, :class:`EnvBuilder` provides this utility method that can be
462-
called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to
463-
assist in installing custom scripts into the virtual environment.
464-
465448
.. method:: install_scripts(context, path)
466449

450+
This method can be
451+
called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to
452+
assist in installing custom scripts into the virtual environment.
453+
467454
*path* is the path to a directory that should contain subdirectories
468455
``common``, ``posix``, ``nt``; each containing scripts destined for the
469456
``bin`` directory in the environment. The contents of ``common`` and the
@@ -495,6 +482,16 @@ creation according to their needs, the :class:`EnvBuilder` class.
495482

496483
.. versionadded:: 3.13
497484

485+
.. versionchanged:: 3.7.2
486+
Windows now uses redirector scripts for ``python[w].exe`` instead of
487+
copying the actual binaries. In 3.7.2 only :meth:`setup_python` does
488+
nothing unless running from a build in the source tree.
489+
490+
.. versionchanged:: 3.7.3
491+
Windows copies the redirector scripts as part of :meth:`setup_python`
492+
instead of :meth:`setup_scripts`. This was not the case in 3.7.2.
493+
When using symlinks, the original executables will be linked.
494+
498495
There is also a module-level convenience function:
499496

500497
.. function:: create(env_dir, system_site_packages=False, clear=False, \

0 commit comments

Comments
 (0)