Skip to content

Commit 1b23035

Browse files
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 <[email protected]>
1 parent fb08116 commit 1b23035

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

crates/uv-cli/src/lib.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -618,21 +618,22 @@ pub struct PipNamespace {
618618

619619
#[derive(Subcommand)]
620620
pub enum PipCommand {
621-
/// Compile a `requirements.in` file to a `requirements.txt` file.
621+
/// Compile a `requirements.in` file to a `requirements.txt` or `pylock.toml` file.
622622
#[command(
623623
after_help = "Use `uv help pip compile` for more details.",
624624
after_long_help = ""
625625
)]
626626
Compile(PipCompileArgs),
627-
/// Sync an environment with a `requirements.txt` file.
627+
/// Sync an environment with a `requirements.txt` or `pylock.toml` file.
628628
///
629-
/// When syncing an environment, any packages not listed in the `requirements.txt` file will
630-
/// be removed. To retain extraneous packages, use `uv pip install` instead.
629+
/// When syncing an environment, any packages not listed in the `requirements.txt` or
630+
/// `pylock.toml` file will be removed. To retain extraneous packages, use `uv pip install`
631+
/// instead.
631632
///
632-
/// The `requirements.txt` file is presumed to be the output of a `pip compile` or `uv export`
633-
/// operation, in which it will include all transitive dependencies. If transitive dependencies
634-
/// are not present in the file, they will not be installed. Use `--strict` to warn if any
635-
/// transitive dependencies are missing.
633+
/// The input file is presumed to be the output of a `pip compile` or `uv export` operation,
634+
/// in which it will include all transitive dependencies. If transitive dependencies are not
635+
/// present in the file, they will not be installed. Use `--strict` to warn if any transitive
636+
/// dependencies are missing.
636637
#[command(
637638
after_help = "Use `uv help pip sync` for more details.",
638639
after_long_help = ""
@@ -815,7 +816,7 @@ pub enum ProjectCommand {
815816
Lock(LockArgs),
816817
/// Export the project's lockfile to an alternate format.
817818
///
818-
/// At present, only `requirements-txt` is supported.
819+
/// At present, both `requirements.txt` and `pylock.toml` (PEP 751) formats are supported.
819820
///
820821
/// The project is re-locked before exporting unless the `--locked` or `--frozen` flag is
821822
/// provided.
@@ -1605,7 +1606,7 @@ pub struct PipInstallArgs {
16051606
#[arg(group = "sources")]
16061607
pub package: Vec<String>,
16071608

1608-
/// Install all packages listed in the given `requirements.txt` files.
1609+
/// Install all packages listed in the given `requirements.txt` or `pylock.toml` files.
16091610
///
16101611
/// If a `pyproject.toml`, `setup.py`, or `setup.cfg` file is provided, uv will extract the
16111612
/// requirements for the relevant project.

docs/reference/cli.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,7 +2214,7 @@ uv lock [OPTIONS]
22142214

22152215
Export the project's lockfile to an alternate format.
22162216

2217-
At present, only `requirements-txt` is supported.
2217+
At present, both `requirements.txt` and `pylock.toml` (PEP 751) formats are supported.
22182218

22192219
The project is re-locked before exporting unless the `--locked` or `--frozen` flag is provided.
22202220

@@ -5553,9 +5553,9 @@ uv pip [OPTIONS] <COMMAND>
55535553

55545554
<h3 class="cli-reference">Commands</h3>
55555555

5556-
<dl class="cli-reference"><dt><a href="#uv-pip-compile"><code>uv pip compile</code></a></dt><dd><p>Compile a <code>requirements.in</code> file to a <code>requirements.txt</code> file</p>
5556+
<dl class="cli-reference"><dt><a href="#uv-pip-compile"><code>uv pip compile</code></a></dt><dd><p>Compile a <code>requirements.in</code> file to a <code>requirements.txt</code> or <code>pylock.toml</code> file</p>
55575557
</dd>
5558-
<dt><a href="#uv-pip-sync"><code>uv pip sync</code></a></dt><dd><p>Sync an environment with a <code>requirements.txt</code> file</p>
5558+
<dt><a href="#uv-pip-sync"><code>uv pip sync</code></a></dt><dd><p>Sync an environment with a <code>requirements.txt</code> or <code>pylock.toml</code> file</p>
55595559
</dd>
55605560
<dt><a href="#uv-pip-install"><code>uv pip install</code></a></dt><dd><p>Install packages into an environment</p>
55615561
</dd>
@@ -5575,7 +5575,7 @@ uv pip [OPTIONS] <COMMAND>
55755575

55765576
### uv pip compile
55775577

5578-
Compile a `requirements.in` file to a `requirements.txt` file
5578+
Compile a `requirements.in` file to a `requirements.txt` or `pylock.toml` file
55795579

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

@@ -6141,11 +6141,11 @@ uv pip compile [OPTIONS] <SRC_FILE|--group <GROUP>>
61416141

61426142
### uv pip sync
61436143

6144-
Sync an environment with a `requirements.txt` file.
6144+
Sync an environment with a `requirements.txt` or `pylock.toml` file.
61456145

6146-
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.
6146+
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.
61476147

6148-
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.
6148+
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.
61496149

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

@@ -7050,7 +7050,7 @@ uv pip install [OPTIONS] <PACKAGE|--requirements <REQUIREMENTS>|--editable <EDIT
70507050
</ul>
70517051

70527052
<p>May also be set with the <code>UV_REQUIRE_HASHES</code> environment variable.</p>
7053-
</dd><dt id="uv-pip-install--requirements"><a href="#uv-pip-install--requirements"><code>--requirements</code></a>, <code>--requirement</code>, <code>-r</code> <i>requirements</i></dt><dd><p>Install all packages listed in the given <code>requirements.txt</code> files.</p>
7053+
</dd><dt id="uv-pip-install--requirements"><a href="#uv-pip-install--requirements"><code>--requirements</code></a>, <code>--requirement</code>, <code>-r</code> <i>requirements</i></dt><dd><p>Install all packages listed in the given <code>requirements.txt</code> or <code>pylock.toml</code> files.</p>
70547054

70557055
<p>If a <code>pyproject.toml</code>, <code>setup.py</code>, or <code>setup.cfg</code> file is provided, uv will extract the requirements for the relevant project.</p>
70567056

0 commit comments

Comments
 (0)