-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn when project-specific settings are passed to non-project uv run
commands
#5977
Conversation
} | ||
if frozen { | ||
warn_user_once!("`--frozen` has no effect alongside `--no-project`"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could enforce these specific warnings via Clap, and make them errors. But the others must be done at runtime, because we don't know if we'll discover a project when we first parse the arguments. So I just did them all as warnings for consistency.
@@ -187,11 +187,42 @@ pub(crate) async fn run( | |||
// Discover and sync the base environment. | |||
let temp_dir; | |||
let base_interpreter = if let Some(script_interpreter) = script_interpreter { | |||
// If we found a PEP 723 script and the user provided a project-only setting, warn. | |||
if !extras.is_empty() { | |||
warn_user_once!("Extras are not supported for Python scripts"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change this to show specific CLI arguments when I do #5855 (I'll need access to the args to fix that).
crates/uv/tests/run.rs
Outdated
|
||
----- stderr ----- | ||
Reading inline script metadata from: main.py | ||
warning: `--no-project` is a no-op for Python scripts, which always run in isolation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python scripts with inline metadata — not all Python scripts.
crates/uv/tests/run.rs
Outdated
|
||
----- stderr ----- | ||
warning: `uv run` is experimental and may change without warning | ||
warning: `--locked` has no effect alongside `--no-project` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor preference for "when used with" instead of "alongside".
// If we can't find a project and the user provided a project-only setting, warn. | ||
if project.is_none() { | ||
if !extras.is_empty() { | ||
warn_user_once!("Extras were provided, but no project was found"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extras were "requested"?
Is this the only interface this applies to? Thank you! |
Arguably also |
d9b35fb
to
a43e8a3
Compare
Summary
Closes #5856.