Set --dev to default for uv run and uv sync (#4118)
## Summary Closes https://github.com/astral-sh/uv/issues/4117.
This commit is contained in:
@@ -1691,10 +1691,11 @@ pub(crate) struct RunArgs {
|
||||
pub(crate) no_all_extras: bool,
|
||||
|
||||
/// Include development dependencies.
|
||||
#[arg(long, overrides_with("no_dev"))]
|
||||
#[arg(long, overrides_with("no_dev"), hide = true)]
|
||||
pub(crate) dev: bool,
|
||||
|
||||
#[arg(long, conflicts_with("offline"), overrides_with("dev"), hide = true)]
|
||||
/// Omit development dependencies.
|
||||
#[arg(long, overrides_with("dev"))]
|
||||
pub(crate) no_dev: bool,
|
||||
|
||||
/// The command to run.
|
||||
@@ -1779,10 +1780,11 @@ pub(crate) struct SyncArgs {
|
||||
pub(crate) no_all_extras: bool,
|
||||
|
||||
/// Include development dependencies.
|
||||
#[arg(long, overrides_with("no_dev"))]
|
||||
#[arg(long, overrides_with("no_dev"), hide = true)]
|
||||
pub(crate) dev: bool,
|
||||
|
||||
#[arg(long, conflicts_with("offline"), overrides_with("dev"), hide = true)]
|
||||
/// Omit development dependencies.
|
||||
#[arg(long, overrides_with("dev"))]
|
||||
pub(crate) no_dev: bool,
|
||||
|
||||
/// Refresh all cached data.
|
||||
|
||||
@@ -170,7 +170,7 @@ impl RunSettings {
|
||||
flag(all_extras, no_all_extras).unwrap_or_default(),
|
||||
extra.unwrap_or_default(),
|
||||
),
|
||||
dev: flag(dev, no_dev).unwrap_or(false),
|
||||
dev: flag(dev, no_dev).unwrap_or(true),
|
||||
target,
|
||||
args,
|
||||
with,
|
||||
@@ -278,7 +278,7 @@ impl SyncSettings {
|
||||
flag(all_extras, no_all_extras).unwrap_or_default(),
|
||||
extra.unwrap_or_default(),
|
||||
),
|
||||
dev: flag(dev, no_dev).unwrap_or(false),
|
||||
dev: flag(dev, no_dev).unwrap_or(true),
|
||||
python,
|
||||
}
|
||||
}
|
||||
@@ -445,7 +445,6 @@ impl PipCompileSettings {
|
||||
PipOptions {
|
||||
python,
|
||||
system: flag(system, no_system),
|
||||
|
||||
index_url: index_args.index_url.and_then(Maybe::into_option),
|
||||
extra_index_url: index_args.extra_index_url.map(|extra_index_urls| {
|
||||
extra_index_urls
|
||||
|
||||
@@ -1891,7 +1891,7 @@ fn lock_dev() -> Result<()> {
|
||||
});
|
||||
|
||||
// Install from the lockfile, excluding development dependencies.
|
||||
uv_snapshot!(context.filters(), context.sync(), @r###"
|
||||
uv_snapshot!(context.filters(), context.sync().arg("--no-dev"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
@@ -1904,8 +1904,8 @@ fn lock_dev() -> Result<()> {
|
||||
+ project==0.1.0 (from file://[TEMP_DIR]/)
|
||||
"###);
|
||||
|
||||
// Install from the lockfile, including development dependencies.
|
||||
uv_snapshot!(context.filters(), context.sync().arg("--dev"), @r###"
|
||||
// Install from the lockfile, including development dependencies (the default).
|
||||
uv_snapshot!(context.filters(), context.sync(), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
Reference in New Issue
Block a user