Skip to content
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

Fix list rendering in venv --help output #1459

Merged
merged 1 commit into from
Feb 16, 2024
Merged
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
8 changes: 4 additions & 4 deletions crates/uv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,15 +632,15 @@ struct VenvArgs {
/// The Python interpreter to use for the virtual environment.
///
/// Supported formats:
/// * `-p 3.10` searches for an installed Python 3.10 (`py --list-paths` on Windows, `python3.10` on Linux/Mac).
/// - `3.10` searches for an installed Python 3.10 (`py --list-paths` on Windows, `python3.10` on Linux/Mac).
/// Specifying a patch version is not supported.
/// * `-p python3.10` or `-p python.exe` looks for a binary in `PATH`.
/// * `-p /home/ferris/.local/bin/python3.10` uses this exact Python.
/// - `python3.10` or `python.exe` looks for a binary in `PATH`.
/// - `/home/ferris/.local/bin/python3.10` uses this exact Python.
Comment on lines -635 to +638
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we toggle the comment with cfg to have it be platform relevant? I think that'd make it a lot shorter and it wouldn't need to be listed like this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Happy to track this in a follow-up too)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, no if cfg applies to comments. We could define a custom struct for the Path and have two different definitions for each platform but that's a bit more involved (and requires copying the configuration)

///
/// Note that this is different from `--python-version` in `pip compile`, which takes `3.10` or `3.10.13` and
/// doesn't look for a Python interpreter on disk.
// Short `-p` to match `virtualenv`
#[clap(short, long)]
#[clap(short, long, verbatim_doc_comment)]
python: Option<String>,

/// Install seed packages (`pip`, `setuptools`, and `wheel`) into the virtual environment.
Expand Down