Skip to content

Commit

Permalink
Fix references to --python-downloads (it is --no-python-downloads) (
Browse files Browse the repository at this point in the history
#6439)

Noticed in #6409
  • Loading branch information
zanieb committed Aug 22, 2024
1 parent 3c7b169 commit 3dd39e6
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 68 deletions.
39 changes: 17 additions & 22 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,16 @@ pub enum Commands {

/// Manage Python versions and installations
///
/// Generally, uv first searches for Python in a virtual environment, either
/// active or in a `.venv` directory in the current working directory or
/// any parent directory. If a virtual environment is not required, uv will
/// then search for a Python interpreter. Python interpreters are found by
/// searching for Python executables in the `PATH` environment variable.
/// Generally, uv first searches for Python in a virtual environment, either active or in a
/// `.venv` directory in the current working directory or any parent directory. If a virtual
/// environment is not required, uv will then search for a Python interpreter. Python
/// interpreters are found by searching for Python executables in the `PATH` environment
/// variable.
///
/// On Windows, the `py` launcher is also invoked to find Python
/// executables.
/// On Windows, the `py` launcher is also invoked to find Python executables.
///
/// By default, uv will download Python if a version cannot be found. This
/// behavior can be disabled with the `--python-downloads` option.
/// By default, uv will download Python if a version cannot be found. This behavior can be
/// disabled with the `--no-python-downloads` flag or the `python-downloads` setting.
///
/// The `--python` option allows requesting a different interpreter.
///
Expand All @@ -278,26 +277,22 @@ pub enum Commands {
/// - `<implementation>@<version>` e.g. `cpython@3.12`
/// - `<implementation><version>` e.g. `cpython3.12` or `cp312`
/// - `<implementation><version-specifier>` e.g. `cpython>=3.12,<3.13`
/// - `<implementation>-<version>-<os>-<arch>-<libc>` e.g.
/// `cpython-3.12.3-macos-aarch64-none`
/// - `<implementation>-<version>-<os>-<arch>-<libc>` e.g. `cpython-3.12.3-macos-aarch64-none`
///
/// Additionally, a specific system Python interpreter can often be
/// requested with:
/// Additionally, a specific system Python interpreter can often be requested with:
///
/// - `<executable-path>` e.g. `/opt/homebrew/bin/python3`
/// - `<executable-name>` e.g. `mypython3`
/// - `<install-dir>` e.g. `/some/environment/`
///
/// When the `--python` option is used, normal discovery rules apply but
/// discovered interpreters are checked for compatibility with the request,
/// e.g., if `pypy` is requested, uv will first check if the virtual
/// environment contains a PyPy interpreter then check if each executable in
/// the path is a PyPy interpreter.
/// When the `--python` option is used, normal discovery rules apply but discovered interpreters
/// are checked for compatibility with the request, e.g., if `pypy` is requested, uv will first
/// check if the virtual environment contains a PyPy interpreter then check if each executable
/// in the path is a PyPy interpreter.
///
/// uv supports discovering CPython, PyPy, and GraalPy interpreters.
/// Unsupported interpreters will be skipped during discovery. If an
/// unsupported interpreter implementation is requested, uv will exit with
/// an error.
/// uv supports discovering CPython, PyPy, and GraalPy interpreters. Unsupported interpreters
/// will be skipped during discovery. If an unsupported interpreter implementation is requested,
/// uv will exit with an error.
#[clap(verbatim_doc_comment)]
#[command(
after_help = "Use `uv help python` for more details.",
Expand Down
39 changes: 17 additions & 22 deletions crates/uv/tests/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,16 @@ fn help_subcommand() {
----- stdout -----
Manage Python versions and installations
Generally, uv first searches for Python in a virtual environment, either
active or in a `.venv` directory in the current working directory or
any parent directory. If a virtual environment is not required, uv will
then search for a Python interpreter. Python interpreters are found by
searching for Python executables in the `PATH` environment variable.
Generally, uv first searches for Python in a virtual environment, either active or in a
`.venv` directory in the current working directory or any parent directory. If a virtual
environment is not required, uv will then search for a Python interpreter. Python
interpreters are found by searching for Python executables in the `PATH` environment
variable.
On Windows, the `py` launcher is also invoked to find Python
executables.
On Windows, the `py` launcher is also invoked to find Python executables.
By default, uv will download Python if a version cannot be found. This
behavior can be disabled with the `--python-downloads` option.
By default, uv will download Python if a version cannot be found. This behavior can be
disabled with the `--no-python-downloads` flag or the `python-downloads` setting.
The `--python` option allows requesting a different interpreter.
Expand All @@ -221,26 +220,22 @@ fn help_subcommand() {
- `<implementation>@<version>` e.g. `cpython@3.12`
- `<implementation><version>` e.g. `cpython3.12` or `cp312`
- `<implementation><version-specifier>` e.g. `cpython>=3.12,<3.13`
- `<implementation>-<version>-<os>-<arch>-<libc>` e.g.
`cpython-3.12.3-macos-aarch64-none`
- `<implementation>-<version>-<os>-<arch>-<libc>` e.g. `cpython-3.12.3-macos-aarch64-none`
Additionally, a specific system Python interpreter can often be
requested with:
Additionally, a specific system Python interpreter can often be requested with:
- `<executable-path>` e.g. `/opt/homebrew/bin/python3`
- `<executable-name>` e.g. `mypython3`
- `<install-dir>` e.g. `/some/environment/`
When the `--python` option is used, normal discovery rules apply but
discovered interpreters are checked for compatibility with the request,
e.g., if `pypy` is requested, uv will first check if the virtual
environment contains a PyPy interpreter then check if each executable in
the path is a PyPy interpreter.
When the `--python` option is used, normal discovery rules apply but discovered interpreters
are checked for compatibility with the request, e.g., if `pypy` is requested, uv will first
check if the virtual environment contains a PyPy interpreter then check if each executable
in the path is a PyPy interpreter.
uv supports discovering CPython, PyPy, and GraalPy interpreters.
Unsupported interpreters will be skipped during discovery. If an
unsupported interpreter implementation is requested, uv will exit with
an error.
uv supports discovering CPython, PyPy, and GraalPy interpreters. Unsupported interpreters
will be skipped during discovery. If an unsupported interpreter implementation is requested,
uv will exit with an error.
Usage: uv python [OPTIONS] <COMMAND>
Expand Down
5 changes: 3 additions & 2 deletions docs/concepts/python-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ during `uv python install`.

!!! tip

The `--python-downloads` option can be passed to any uv command, or it can be set in a
[persistent configuration file](../configuration/files.md) to change the default behavior.
The `python-downloads` setting can be set in a
[persistent configuration file](../configuration/files.md) to change the default behavior, or
the `--no-python-downloads` flag can be passed to any uv command.

## Adjusting Python version preferences

Expand Down
39 changes: 17 additions & 22 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2866,17 +2866,16 @@ uv tool dir [OPTIONS]

Manage Python versions and installations

Generally, uv first searches for Python in a virtual environment, either
active or in a `.venv` directory in the current working directory or
any parent directory. If a virtual environment is not required, uv will
then search for a Python interpreter. Python interpreters are found by
searching for Python executables in the `PATH` environment variable.
Generally, uv first searches for Python in a virtual environment, either active or in a
`.venv` directory in the current working directory or any parent directory. If a virtual
environment is not required, uv will then search for a Python interpreter. Python
interpreters are found by searching for Python executables in the `PATH` environment
variable.

On Windows, the `py` launcher is also invoked to find Python
executables.
On Windows, the `py` launcher is also invoked to find Python executables.

By default, uv will download Python if a version cannot be found. This
behavior can be disabled with the `--python-downloads` option.
By default, uv will download Python if a version cannot be found. This behavior can be
disabled with the `--no-python-downloads` flag or the `python-downloads` setting.

The `--python` option allows requesting a different interpreter.

Expand All @@ -2888,26 +2887,22 @@ The following Python version request formats are supported:
- `<implementation>@<version>` e.g. `cpython@3.12`
- `<implementation><version>` e.g. `cpython3.12` or `cp312`
- `<implementation><version-specifier>` e.g. `cpython>=3.12,<3.13`
- `<implementation>-<version>-<os>-<arch>-<libc>` e.g.
`cpython-3.12.3-macos-aarch64-none`
- `<implementation>-<version>-<os>-<arch>-<libc>` e.g. `cpython-3.12.3-macos-aarch64-none`

Additionally, a specific system Python interpreter can often be
requested with:
Additionally, a specific system Python interpreter can often be requested with:

- `<executable-path>` e.g. `/opt/homebrew/bin/python3`
- `<executable-name>` e.g. `mypython3`
- `<install-dir>` e.g. `/some/environment/`

When the `--python` option is used, normal discovery rules apply but
discovered interpreters are checked for compatibility with the request,
e.g., if `pypy` is requested, uv will first check if the virtual
environment contains a PyPy interpreter then check if each executable in
the path is a PyPy interpreter.
When the `--python` option is used, normal discovery rules apply but discovered interpreters
are checked for compatibility with the request, e.g., if `pypy` is requested, uv will first
check if the virtual environment contains a PyPy interpreter then check if each executable
in the path is a PyPy interpreter.

uv supports discovering CPython, PyPy, and GraalPy interpreters.
Unsupported interpreters will be skipped during discovery. If an
unsupported interpreter implementation is requested, uv will exit with
an error.
uv supports discovering CPython, PyPy, and GraalPy interpreters. Unsupported interpreters
will be skipped during discovery. If an unsupported interpreter implementation is requested,
uv will exit with an error.

<h3 class="cli-reference">Usage</h3>

Expand Down

0 comments on commit 3dd39e6

Please sign in to comment.