Skip to content

Commit

Permalink
Add uv add --no-editable (#5246)
Browse files Browse the repository at this point in the history
## Summary

Resolves #5241

## Test Plan

```sh
# create a workspace with sub-packages `pkg-a` and `pkg-b`

$ cd ./pkg-b
$ cargo run -- add ./pkg-a --no-editable

$ cat ./pyproject.toml
[project]
name = "pkg-b"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
dependencies = [
    "pkg-a",
]

[tool.uv]
dev-dependencies = []

[tool.uv.sources]
pkg-a = { workspace = true, editable = false }
```
  • Loading branch information
j178 authored Jul 20, 2024
1 parent e809bc3 commit 0611c7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1983,9 +1983,12 @@ pub struct AddArgs {
#[arg(long, conflicts_with("dev"))]
pub optional: Option<ExtraName>,

/// Add the requirements as editables.
#[arg(long, default_missing_value = "true", num_args(0..=1))]
pub editable: Option<bool>,
#[arg(long, overrides_with = "no_editable", hide = true)]
pub editable: bool,

/// Don't add the requirements as editables.
#[arg(long, overrides_with = "editable")]
pub no_editable: bool,

/// Add source requirements to the `project.dependencies` section of the `pyproject.toml`.
///
Expand Down
3 changes: 2 additions & 1 deletion crates/uv/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ impl AddSettings {
dev,
optional,
editable,
no_editable,
extra,
raw_sources,
rev,
Expand Down Expand Up @@ -641,13 +642,13 @@ impl AddSettings {
frozen,
requirements,
dependency_type,
editable,
raw_sources,
rev,
tag,
branch,
package,
python,
editable: flag(editable, no_editable),
extras: extra.unwrap_or_default(),
refresh: Refresh::from(refresh),
settings: ResolverInstallerSettings::combine(
Expand Down

0 comments on commit 0611c7b

Please sign in to comment.