pub struct AddArgs {Show 37 fields
pub packages: Vec<String>,
pub requirements: Vec<PathBuf>,
pub constraints: Vec<Maybe<PathBuf>>,
pub marker: Option<MarkerTree>,
pub dev: bool,
pub optional: Option<ExtraName>,
pub group: Option<GroupName>,
pub editable: bool,
pub no_editable: bool,
pub raw: bool,
pub bounds: Option<AddBoundsKind>,
pub rev: Option<String>,
pub tag: Option<String>,
pub branch: Option<String>,
pub lfs: bool,
pub extra: Option<Vec<ExtraName>>,
pub no_sync: bool,
pub locked: bool,
pub frozen: bool,
pub active: bool,
pub no_active: bool,
pub installer: ResolverInstallerArgs,
pub build: BuildOptionsArgs,
pub refresh: RefreshArgs,
pub package: Option<PackageName>,
pub script: Option<PathBuf>,
pub python: Option<Maybe<String>>,
pub workspace: bool,
pub no_workspace: bool,
pub no_install_project: bool,
pub only_install_project: bool,
pub no_install_workspace: bool,
pub only_install_workspace: bool,
pub no_install_local: bool,
pub only_install_local: bool,
pub no_install_package: Vec<PackageName>,
pub only_install_package: Vec<PackageName>,
}Fields§
§packages: Vec<String>The packages to add, as PEP 508 requirements (e.g., ruff==0.5.0).
requirements: Vec<PathBuf>Add the packages listed in the given files.
The following formats are supported: requirements.txt, .py files with inline metadata,
pylock.toml, pyproject.toml, setup.py, and setup.cfg.
constraints: Vec<Maybe<PathBuf>>Constrain versions using the given requirements files.
Constraints files are requirements.txt-like files that only control the version of a
requirement that’s installed. The constraints will not be added to the project’s
pyproject.toml file, but will be respected during dependency resolution.
This is equivalent to pip’s --constraint option.
marker: Option<MarkerTree>Apply this marker to all added packages.
dev: boolAdd the requirements to the development dependency group.
This option is an alias for --group dev.
optional: Option<ExtraName>Add the requirements to the package’s optional dependencies for the specified extra.
The group may then be activated when installing the project with the --extra flag.
To enable an optional extra for this requirement instead, see --extra.
group: Option<GroupName>Add the requirements to the specified dependency group.
These requirements will not be included in the published metadata for the project.
editable: boolAdd the requirements as editable.
no_editable: bool§raw: boolAdd a dependency as provided.
By default, uv will use the tool.uv.sources section to record source information for Git,
local, editable, and direct URL requirements. When --raw is provided, uv will add source
requirements to project.dependencies, rather than tool.uv.sources.
Additionally, by default, uv will add bounds to your dependency, e.g., foo>=1.0.0. When
--raw is provided, uv will add the dependency without bounds.
bounds: Option<AddBoundsKind>The kind of version specifier to use when adding dependencies.
When adding a dependency to the project, if no constraint or URL is provided, a constraint
is added based on the latest compatible version of the package. By default, a lower bound
constraint is used, e.g., >=1.2.3.
When --frozen is provided, no resolution is performed, and dependencies are always added
without constraints.
This option is in preview and may change in any future release.
rev: Option<String>Commit to use when adding a dependency from Git.
tag: Option<String>Tag to use when adding a dependency from Git.
branch: Option<String>Branch to use when adding a dependency from Git.
lfs: boolWhether to use Git LFS when adding a dependency from Git.
extra: Option<Vec<ExtraName>>Extras to enable for the dependency.
May be provided more than once.
To add this dependency to an optional extra instead, see --optional.
no_sync: boolAvoid syncing the virtual environment.
locked: boolAssert that the uv.lock will remain unchanged.
Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.
frozen: boolAdd dependencies without re-locking the project.
The project environment will not be synced.
active: boolPrefer the active virtual environment over the project’s virtual environment.
If the project virtual environment is active or no virtual environment is active, this has no effect.
no_active: boolPrefer project’s virtual environment over an active environment.
This is the default behavior.
installer: ResolverInstallerArgs§build: BuildOptionsArgs§refresh: RefreshArgs§package: Option<PackageName>Add the dependency to a specific package in the workspace.
script: Option<PathBuf>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 adherence
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.
python: Option<Maybe<String>>The Python interpreter to use for resolving and syncing.
See uv help python for details on Python discovery and supported request formats.
workspace: boolAdd the dependency as a workspace member.
By default, uv will add path dependencies that are within the workspace directory
as workspace members. When used with a path dependency, the package will be added
to the workspace’s members list in the root pyproject.toml file.
no_workspace: boolDon’t add the dependency as a workspace member.
By default, when adding a dependency that’s a local path and is within the workspace
directory, uv will add it as a workspace member; pass --no-workspace to add the package
as direct path dependency instead.
no_install_project: boolDo not install the current project.
By default, the current project is installed into the environment with all of its
dependencies. The --no-install-project option allows the project to be excluded, but all of
its dependencies are still installed. This is particularly useful in situations like building
Docker images where installing the project separately from its dependencies allows optimal
layer caching.
The inverse --only-install-project can be used to install only the project itself,
excluding all dependencies.
only_install_project: boolOnly install the current project.
no_install_workspace: boolDo not install any workspace members, including the current project.
By default, all workspace members and their dependencies are installed into the
environment. The --no-install-workspace option allows exclusion of all the workspace
members while retaining their dependencies. This is particularly useful in situations like
building Docker images where installing the workspace separately from its dependencies
allows optimal layer caching.
The inverse --only-install-workspace can be used to install only workspace members,
excluding all other dependencies.
only_install_workspace: boolOnly install workspace members, including the current project.
no_install_local: boolDo not install local path dependencies
Skips the current project, workspace members, and any other local (path or editable) packages. Only remote/indexed dependencies are installed. Useful in Docker builds to cache heavy third-party dependencies first and layer local packages separately.
The inverse --only-install-local can be used to install only local packages, excluding
all remote dependencies.
only_install_local: boolOnly install local path dependencies
no_install_package: Vec<PackageName>Do not install the given package(s).
By default, all project’s dependencies are installed into the environment. The
--no-install-package option allows exclusion of specific packages. Note this can result
in a broken environment, and should be used with caution.
The inverse --only-install-package can be used to install only the specified packages,
excluding all others.
only_install_package: Vec<PackageName>Only install the given package(s).
Trait Implementations§
Source§impl Args for AddArgs
impl Args for AddArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl FromArgMatches for AddArgs
impl FromArgMatches for AddArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for AddArgs
impl RefUnwindSafe for AddArgs
impl Send for AddArgs
impl Sync for AddArgs
impl Unpin for AddArgs
impl UnwindSafe for AddArgs
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more