mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-03 05:03:46 +00:00
Support PEP 723 scripts in uv add and uv remove (#5995)
## Summary Resolves https://github.com/astral-sh/uv/issues/4667 ## Test Plan `cargo test`
This commit is contained in:
parent
9b8c07bf18
commit
2d53e35e39
12 changed files with 1215 additions and 289 deletions
|
|
@ -2450,6 +2450,16 @@ pub struct AddArgs {
|
|||
#[arg(long, conflicts_with = "isolated")]
|
||||
pub package: Option<PackageName>,
|
||||
|
||||
/// Add the dependency to the specified Python script, rather than to a project.
|
||||
///
|
||||
/// If provided, uv will add the dependency to the script's inline metadata
|
||||
/// table, in adhere with PEP 723. If no such inline metadata table is present,
|
||||
/// a new one will be created and added to the script. When executed via `uv run`,
|
||||
/// uv will create a temporary environment for the script with all inline
|
||||
/// dependencies installed.
|
||||
#[arg(long, conflicts_with = "dev", conflicts_with = "optional")]
|
||||
pub script: Option<PathBuf>,
|
||||
|
||||
/// The Python interpreter to use for resolving and syncing.
|
||||
///
|
||||
/// See `uv help python` for details on Python discovery and supported
|
||||
|
|
@ -2509,6 +2519,13 @@ pub struct RemoveArgs {
|
|||
#[arg(long, conflicts_with = "isolated")]
|
||||
pub package: Option<PackageName>,
|
||||
|
||||
/// Remove the dependency from the specified Python script, rather than from a project.
|
||||
///
|
||||
/// If provided, uv will remove the dependency from the script's inline metadata
|
||||
/// table, in adhere with PEP 723.
|
||||
#[arg(long)]
|
||||
pub script: Option<PathBuf>,
|
||||
|
||||
/// The Python interpreter to use for resolving and syncing.
|
||||
///
|
||||
/// See `uv help python` for details on Python discovery and supported
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue