Add pylock.toml mentions where relevant (#13115)

Just a small PR to add mentions to `pylock.toml` in the CLI manual where
appropriate.

I tried to say "PEP-751 compatible lock files" when appropriate to also
include the case `r"^pylock\.([^.]+)\.toml$"`. Feel free to change that
if you think it's cluttery.

I also tried to include the "single-use" wording when it made sense.

I also have almost never used the `uv pip` interface, so maybe there are
some other minor things to add here and there about the usage of
`pylock.toml` that I missed.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
ReinforcedKnowledge 2025-04-26 16:26:30 +02:00 committed by GitHub
parent fb08116800
commit 1b23035703
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 18 deletions

View file

@ -618,21 +618,22 @@ pub struct PipNamespace {
#[derive(Subcommand)]
pub enum PipCommand {
/// Compile a `requirements.in` file to a `requirements.txt` file.
/// Compile a `requirements.in` file to a `requirements.txt` or `pylock.toml` file.
#[command(
after_help = "Use `uv help pip compile` for more details.",
after_long_help = ""
)]
Compile(PipCompileArgs),
/// Sync an environment with a `requirements.txt` file.
/// Sync an environment with a `requirements.txt` or `pylock.toml` file.
///
/// When syncing an environment, any packages not listed in the `requirements.txt` file will
/// be removed. To retain extraneous packages, use `uv pip install` instead.
/// When syncing an environment, any packages not listed in the `requirements.txt` or
/// `pylock.toml` file will be removed. To retain extraneous packages, use `uv pip install`
/// instead.
///
/// The `requirements.txt` file is presumed to be the output of a `pip compile` or `uv export`
/// operation, in which it will include all transitive dependencies. If transitive dependencies
/// are not present in the file, they will not be installed. Use `--strict` to warn if any
/// transitive dependencies are missing.
/// The input file is presumed to be the output of a `pip compile` or `uv export` operation,
/// in which it will include all transitive dependencies. If transitive dependencies are not
/// present in the file, they will not be installed. Use `--strict` to warn if any transitive
/// dependencies are missing.
#[command(
after_help = "Use `uv help pip sync` for more details.",
after_long_help = ""
@ -815,7 +816,7 @@ pub enum ProjectCommand {
Lock(LockArgs),
/// Export the project's lockfile to an alternate format.
///
/// At present, only `requirements-txt` is supported.
/// At present, both `requirements.txt` and `pylock.toml` (PEP 751) formats are supported.
///
/// The project is re-locked before exporting unless the `--locked` or `--frozen` flag is
/// provided.
@ -1605,7 +1606,7 @@ pub struct PipInstallArgs {
#[arg(group = "sources")]
pub package: Vec<String>,
/// Install all packages listed in the given `requirements.txt` files.
/// Install all packages listed in the given `requirements.txt` or `pylock.toml` files.
///
/// If a `pyproject.toml`, `setup.py`, or `setup.cfg` file is provided, uv will extract the
/// requirements for the relevant project.