Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4147,8 +4147,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 @@ -4327,6 +4331,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 `cpython@3.10`.
///
/// 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>cpython@3.10</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