-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-130160: use .. program::
directive for documenting venv
CLI
#130699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4dc832e
c8ee8c3
a4df05e
1419051
918676c
f0285a2
34753d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,8 @@ See :pep:`405` for more background on Python virtual environments. | |
|
||
Creating virtual environments | ||
----------------------------- | ||
.. _venv-cli: | ||
.. program:: venv | ||
|
||
:ref:`Virtual environments <venv-def>` are created by executing the ``venv`` | ||
module: | ||
|
@@ -81,21 +83,6 @@ It also creates a :file:`lib/pythonX.Y/site-packages` subdirectory | |
(on Windows, this is :file:`Lib\site-packages`). | ||
If an existing directory is specified, it will be re-used. | ||
|
||
.. versionchanged:: 3.5 | ||
The use of ``venv`` is now recommended for creating virtual environments. | ||
|
||
.. deprecated-removed:: 3.6 3.8 | ||
:program:`pyvenv` was the recommended tool for creating virtual environments | ||
for Python 3.3 and 3.4, and replaced in 3.5 by executing ``venv`` directly. | ||
|
||
.. highlight:: none | ||
|
||
On Windows, invoke the ``venv`` command as follows: | ||
|
||
.. code-block:: ps1con | ||
|
||
PS> python -m venv C:\path\to\new\virtual\environment | ||
Comment on lines
-95
to
-97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this removed? |
||
|
||
The command, if run with ``-h``, will show the available options:: | ||
|
||
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] | ||
Comment on lines
86
to
88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Mr-Sunglasses I understood that the problem is that there is duplicate information about could you remove it leaving only the use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There should IMO be something that shows how to invoke it, e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are absolutely right. I forgot about it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case, I suggest shortening the help. Currently it's as follows: Instead I suggest we only keep
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and maybe it would be better to remove following text from code block:
|
||
|
@@ -135,6 +122,46 @@ The command, if run with ``-h``, will show the available options:: | |
Once an environment has been created, you may wish to activate it, e.g. by | ||
sourcing an activate script in its bin directory. | ||
|
||
Mr-Sunglasses marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.. option:: ENV_DIR | ||
|
||
A required argument specifying the directory to create the environment in. | ||
|
||
.. option:: --system-site-packages | ||
|
||
Give the virtual environment access to the system site-packages directory. | ||
|
||
.. option:: --symlinks | ||
|
||
Try to use symlinks rather than copies, when symlinks are not the default for the platform. | ||
|
||
.. option:: --copies | ||
|
||
Try to use copies rather than symlinks, even when symlinks are the default for the platform. | ||
|
||
.. option:: --clear | ||
|
||
Delete the contents of the environment directory if it already exists, before environment creation. | ||
|
||
.. option:: --upgrade | ||
|
||
Upgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place. | ||
|
||
.. option:: --without-pip | ||
|
||
Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default). | ||
|
||
.. option:: --prompt <PROMPT> | ||
|
||
Provides an alternative prompt prefix for this environment. | ||
|
||
.. option:: --upgrade-deps | ||
|
||
Upgrade core dependencies (pip) to the latest version in PyPI. | ||
|
||
.. option:: --without-scm-ignore-files | ||
|
||
Skips adding SCM ignore files to the environment directory (Git is supported by default). | ||
|
||
|
||
.. versionchanged:: 3.4 | ||
Installs pip by default, added the ``--without-pip`` and ``--copies`` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed?