Skip to content

Commit

Permalink
docs: add docs to uv python pin without a REQUEST argument (#9631)
Browse files Browse the repository at this point in the history
Co-authored-by: Zanie Blue <[email protected]>
  • Loading branch information
nonZero and zanieb authored Dec 4, 2024
1 parent e85319e commit 231504b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 8 additions & 2 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4159,8 +4159,12 @@ pub enum PythonCommand {

/// Pin to a specific Python version.
///
/// Writes the pinned version to a `.python-version` file, which is then
/// read by other uv commands when determining the required Python version.
/// Writes the pinned Python version to a `.python-version` file, which is used by other uv
/// commands to determine the required Python version.
///
/// If no version is provided, uv will look for an existing `.python-version` file and display
/// the currently pinned version. If no `.python-version` file is found, uv will exit with an
/// error.
///
/// See `uv help python` to view supported request formats.
Pin(PythonPinArgs),
Expand Down Expand Up @@ -4339,6 +4343,8 @@ pub struct PythonPinArgs {
/// files, i.e., `pyenv`. If compatibility with those tools is needed, only
/// use version numbers instead of complex requests such as `[email protected]`.
///
/// If no request is provided, the currently pinned version will be shown.
///
/// See `uv help python` to view supported request formats.
pub request: Option<String>,

Expand Down
6 changes: 5 additions & 1 deletion docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4771,7 +4771,9 @@ uv python find [OPTIONS] [REQUEST]

Pin to a specific Python version.

Writes the pinned version to a `.python-version` file, which is then read by other uv commands when determining the required Python version.
Writes the pinned Python version to a `.python-version` file, which is used by other uv commands to determine the required Python version.

If no version is provided, uv will look for an existing `.python-version` file and display the currently pinned version. If no `.python-version` file is found, uv will exit with an error.

See `uv help python` to view supported request formats.

Expand All @@ -4787,6 +4789,8 @@ uv python pin [OPTIONS] [REQUEST]

<p>uv supports more formats than other tools that read <code>.python-version</code> files, i.e., <code>pyenv</code>. If compatibility with those tools is needed, only use version numbers instead of complex requests such as <code>[email protected]</code>.</p>

<p>If no request is provided, the currently pinned version will be shown.</p>

<p>See <a href="#uv-python">uv python</a> to view supported request formats.</p>

</dd></dl>
Expand Down

0 comments on commit 231504b

Please sign in to comment.