Skip to content

Commit

Permalink
Document uv add and uv remove behavior with markers
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Aug 16, 2024
1 parent 35cdd43 commit 5a467fe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
31 changes: 18 additions & 13 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,22 +548,24 @@ pub enum ProjectCommand {
///
/// Dependencies are added to the project's `pyproject.toml` file.
///
/// If no constraint or URL is provided for a dependency, a lower bound is
/// added equal to the latest compatible version of the package, e.g.,
/// `>=1.2.3`, unless `--frozen` is provided, in which case no resolution is
/// performed.
/// If a given depedency exists already, it will be updated to the new version specifier unless

Check warning on line 551 in crates/uv-cli/src/lib.rs

View workflow job for this annotation

GitHub Actions / typos

"depedency" should be "dependency".
/// it includes markers that differ from the existing specifier in which case another entry for
/// the depenedency will be added.
///
/// The lockfile and project environment will be updated to reflect the
/// added dependencies. To skip updating the lockfile, use `--frozen`. To
/// skip updating the environment, use `--no-sync`.
/// If no constraint or URL is provided for a dependency, a lower bound is added equal to the
/// latest compatible version of the package, e.g., `>=1.2.3`, unless `--frozen` is provided, in
/// which case no resolution is performed.
///
/// If any of the requested dependencies cannot be found, uv will exit with
/// an error, unless the `--frozen` flag is provided, in which case uv will
/// add the dependencies verbatim without checking that they exist or are
/// compatible with the project.
/// The lockfile and project environment will be updated to reflect the added dependencies. To
/// skip updating the lockfile, use `--frozen`. To skip updating the environment, use
/// `--no-sync`.
///
/// uv will search for a project in the current directory or any parent
/// directory. If a project cannot be found, uv will exit with an error.
/// If any of the requested dependencies cannot be found, uv will exit with an error, unless the
/// `--frozen` flag is provided, in which case uv will add the dependencies verbatim without
/// checking that they exist or are compatible with the project.
///
/// uv will search for a project in the current directory or any parent directory. If a project
/// cannot be found, uv will exit with an error.
#[command(
after_help = "Use `uv help add` for more details.",
after_long_help = ""
Expand All @@ -573,6 +575,9 @@ pub enum ProjectCommand {
///
/// Dependencies are removed from the project's `pyproject.toml` file.
///
/// If multiple entries exist for a given dependency, i.e., each with different markers, all of
/// the entries will be removed.
///
/// The lockfile and project environment will be updated to reflect the
/// removed dependencies. To skip updating the lockfile, use `--frozen`. To
/// skip updating the environment, use `--no-sync`.
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ Add dependencies to the project (experimental).

Dependencies are added to the project's `pyproject.toml` file.

If a given depedency exists already, it will be updated to the new version specifier unless it includes markers that differ from the existing specifier in which case another entry for the depenedency will be added.

Check warning on line 458 in docs/reference/cli.md

View workflow job for this annotation

GitHub Actions / typos

"depedency" should be "dependency".

If no constraint or URL is provided for a dependency, a lower bound is added equal to the latest compatible version of the package, e.g., `>=1.2.3`, unless `--frozen` is provided, in which case no resolution is performed.

The lockfile and project environment will be updated to reflect the added dependencies. To skip updating the lockfile, use `--frozen`. To skip updating the environment, use `--no-sync`.
Expand Down Expand Up @@ -735,6 +737,8 @@ Remove dependencies from the project (experimental).

Dependencies are removed from the project's `pyproject.toml` file.

If multiple entries exist for a given dependency, i.e., each with different markers, all of the entries will be removed.

The lockfile and project environment will be updated to reflect the removed dependencies. To skip updating the lockfile, use `--frozen`. To skip updating the environment, use `--no-sync`.

If any of the requested dependencies are not present in the project, uv will exit with an error.
Expand Down

0 comments on commit 5a467fe

Please sign in to comment.