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:
Charlie Marsh
2024-06-06 20:06:05 -04:00
committed by GitHub
parent dcf70a1f29
commit d3651c13f0
3 changed files with 11 additions and 10 deletions
+6 -4
View File
@@ -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.
+2 -3
View File
@@ -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
+3 -3
View File
@@ -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 -----