diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index c8a785421..8f85f567c 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -1192,7 +1192,10 @@ fn parse_maybe_string(input: &str) -> Result, String> { #[derive(Args)] #[command(group = clap::ArgGroup::new("sources").required(true).multiple(true))] pub struct PipCompileArgs { - /// Include all packages listed in the given `requirements.in` files. + /// Include the packages listed in the given files. + /// + /// The following formats are supported: `requirements.txt`, `.py` files with inline metadata, + /// `pylock.toml`, `pyproject.toml`, `setup.py`, and `setup.cfg`. /// /// If a `pyproject.toml`, `setup.py`, or `setup.cfg` file is provided, uv will extract the /// requirements for the relevant project. @@ -1544,7 +1547,10 @@ pub struct PipCompileArgs { #[derive(Args)] pub struct PipSyncArgs { - /// Include all packages listed in the given `requirements.txt` files. + /// Include the packages listed in the given files. + /// + /// The following formats are supported: `requirements.txt`, `.py` files with inline metadata, + /// `pylock.toml`, `pyproject.toml`, `setup.py`, and `setup.cfg`. /// /// If a `pyproject.toml`, `setup.py`, or `setup.cfg` file is provided, uv will /// extract the requirements for the relevant project. @@ -1836,7 +1842,10 @@ pub struct PipInstallArgs { #[arg(group = "sources")] pub package: Vec, - /// Install all packages listed in the given `requirements.txt`, PEP 723 scripts, or `pylock.toml` files. + /// Install the packages listed in the given files. + /// + /// The following formats are supported: `requirements.txt`, `.py` files with inline metadata, + /// `pylock.toml`, `pyproject.toml`, `setup.py`, and `setup.cfg`. /// /// If a `pyproject.toml`, `setup.py`, or `setup.cfg` file is provided, uv will extract the /// requirements for the relevant project. @@ -2155,7 +2164,10 @@ pub struct PipUninstallArgs { #[arg(group = "sources")] pub package: Vec, - /// Uninstall all packages listed in the given requirements files. + /// Uninstall the packages listed in the given files. + /// + /// The following formats are supported: `requirements.txt`, `.py` files with inline metadata, + /// `pylock.toml`, `pyproject.toml`, `setup.py`, and `setup.cfg`. #[arg(long, short, alias = "requirement", group = "sources", value_parser = parse_file_path)] pub requirements: Vec, @@ -3210,8 +3222,10 @@ pub struct RunArgs { #[arg(long)] pub with_editable: Vec, - /// Run with all packages listed in the given `requirements.txt` files or PEP 723 Python - /// scripts. + /// Run with the packages listed in the given files. + /// + /// The following formats are supported: `requirements.txt`, `.py` files with inline metadata, + /// and `pylock.toml`. /// /// The same environment semantics as `--with` apply. /// @@ -3735,7 +3749,10 @@ pub struct AddArgs { #[arg(group = "sources")] pub packages: Vec, - /// Add all packages listed in the given `requirements.txt` files. + /// Add the packages listed in the given files. + /// + /// The following formats are supported: `requirements.txt`, `.py` files with inline metadata, + /// `pylock.toml`, `pyproject.toml`, `setup.py`, and `setup.cfg`. #[arg(long, short, alias = "requirement", group = "sources", value_parser = parse_file_path)] pub requirements: Vec, @@ -4591,8 +4608,10 @@ pub struct ToolRunArgs { #[arg(long)] pub with_editable: Vec, - /// Run with all packages listed in the given `requirements.txt` files or PEP 723 Python - /// scripts. + /// Run with the packages listed in the given files. + /// + /// The following formats are supported: `requirements.txt`, `.py` files with inline metadata, + /// and `pylock.toml`. #[arg(long, value_delimiter = ',', value_parser = parse_maybe_file_path)] pub with_requirements: Vec>, @@ -4722,8 +4741,10 @@ pub struct ToolInstallArgs { #[arg(short = 'w', long)] pub with: Vec, - /// Run with all packages listed in the given `requirements.txt` files or PEP 723 Python - /// scripts. + /// Run with the packages listed in the given files. + /// + /// The following formats are supported: `requirements.txt`, `.py` files with inline metadata, + /// and `pylock.toml`. #[arg(long, value_delimiter = ',', value_parser = parse_maybe_file_path)] pub with_requirements: Vec>, diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 7e77a235c..6903c7a79 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -611,7 +611,8 @@ used.

When used in a project, these dependencies will be layered on top of the project environment in a separate, ephemeral environment. These dependencies are allowed to conflict with those specified by the project.

--with-editable with-editable

Run with the given packages installed in editable mode.

When used in a project, these dependencies will be layered on top of the project environment in a separate, ephemeral environment. These dependencies are allowed to conflict with those specified by the project.

-
--with-requirements with-requirements

Run with all packages listed in the given requirements.txt files or PEP 723 Python scripts.

+
--with-requirements with-requirements

Run with the packages listed in the given files.

+

The following formats are supported: requirements.txt, .py files with inline metadata, and pylock.toml.

The same environment semantics as --with apply.

Using pyproject.toml, setup.py, or setup.cfg files is not allowed.

@@ -941,7 +942,8 @@ uv add [OPTIONS] >
--refresh-package refresh-package

Refresh cached data for a specific package

--reinstall, --force-reinstall

Reinstall all packages, regardless of whether they're already installed. Implies --refresh

--reinstall-package reinstall-package

Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

-
--requirements, --requirement, -r requirements

Add all packages listed in the given requirements.txt files

+
--requirements, --requirement, -r requirements

Add the packages listed in the given files.

+

The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

May also be set with the UV_RESOLUTION environment variable.

Possible values:

@@ -2546,7 +2548,8 @@ uv tool run [OPTIONS] [COMMAND]
--with, -w with

Run with the given packages installed

--with-editable with-editable

Run with the given packages installed in editable mode

When used in a project, these dependencies will be layered on top of the uv tool's environment in a separate, ephemeral environment. These dependencies are allowed to conflict with those specified.

-
--with-requirements with-requirements

Run with all packages listed in the given requirements.txt files or PEP 723 Python scripts

+
--with-requirements with-requirements

Run with the packages listed in the given files.

+

The following formats are supported: requirements.txt, .py files with inline metadata, and pylock.toml.

### uv tool install @@ -2773,7 +2776,8 @@ uv tool install [OPTIONS]
--with, -w with

Include the following additional requirements

--with-editable with-editable

Include the given packages in editable mode

--with-executables-from with-executables-from

Install executables from the following packages

-
--with-requirements with-requirements

Run with all packages listed in the given requirements.txt files or PEP 723 Python scripts

+
--with-requirements with-requirements

Run with the packages listed in the given files.

+

The following formats are supported: requirements.txt, .py files with inline metadata, and pylock.toml.

### uv tool upgrade @@ -3988,7 +3992,8 @@ uv pip compile [OPTIONS] >

Arguments

-
SRC_FILE

Include all packages listed in the given requirements.in files.

+
SRC_FILE

Include the packages listed in the given files.

+

The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

If a pyproject.toml, setup.py, or setup.cfg file is provided, uv will extract the requirements for the relevant project.

If - is provided, then requirements will be read from stdin.

The order of the requirements files and the requirements in them is used to determine priority during resolution.

@@ -4311,7 +4316,8 @@ uv pip sync [OPTIONS] ...

Arguments

-
SRC_FILE

Include all packages listed in the given requirements.txt files.

+
SRC_FILE

Include the packages listed in the given files.

+

The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

If a pyproject.toml, setup.py, or setup.cfg file is provided, uv will extract the requirements for the relevant project.

If - is provided, then requirements will be read from stdin.

@@ -4808,7 +4814,8 @@ should be used with caution, as it can modify the system Python installation.

  • Git dependencies are not supported. - Editable installations are not supported. - Local dependencies are not supported, unless they point to a specific wheel (.whl) or source archive (.zip, .tar.gz), as opposed to a directory.
  • -

    May also be set with the UV_REQUIRE_HASHES environment variable.

    --requirements, --requirement, -r requirements

    Install all packages listed in the given requirements.txt, PEP 723 scripts, or pylock.toml files.

    +

    May also be set with the UV_REQUIRE_HASHES environment variable.

    --requirements, --requirement, -r requirements

    Install the packages listed in the given files.

    +

    The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

    If a pyproject.toml, setup.py, or setup.cfg file is provided, uv will extract the requirements for the relevant project.

    If - is provided, then requirements will be read from stdin.

    --resolution resolution

    The strategy to use when selecting between the different compatible versions for a given package requirement.

    @@ -4955,7 +4962,8 @@ should be used with caution, as it can modify the system Python installation.

    See uv python for details on Python discovery and supported request formats.

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --requirements, --requirement, -r requirements

    Uninstall all packages listed in the given requirements files

    +
    --requirements, --requirement, -r requirements

    Uninstall the packages listed in the given files.

    +

    The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

    --system

    Use the system Python to uninstall packages.

    By default, uv uninstalls from the virtual environment in the current working directory or any parent directory. The --system option instructs uv to instead use the first Python found in the system PATH.

    WARNING: --system is intended for use in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.