pub struct PipCompileArgs {Show 51 fields
pub src_file: Vec<PathBuf>,
pub constraints: Vec<Maybe<PathBuf>>,
pub overrides: Vec<Maybe<PathBuf>>,
pub excludes: Vec<Maybe<PathBuf>>,
pub build_constraints: Vec<Maybe<PathBuf>>,
pub extra: Option<Vec<ExtraName>>,
pub all_extras: bool,
pub no_all_extras: bool,
pub group: Vec<PipGroupName>,
pub resolver: ResolverArgs,
pub refresh: RefreshArgs,
pub no_deps: bool,
pub deps: bool,
pub output_file: Option<PathBuf>,
pub format: Option<PipCompileFormat>,
pub no_strip_extras: bool,
pub strip_extras: bool,
pub no_strip_markers: bool,
pub strip_markers: bool,
pub no_annotate: bool,
pub annotate: bool,
pub no_header: bool,
pub header: bool,
pub annotation_style: Option<AnnotationStyle>,
pub custom_compile_command: Option<String>,
pub python: Option<Maybe<String>>,
pub system: bool,
pub no_system: bool,
pub generate_hashes: bool,
pub no_generate_hashes: bool,
pub no_build: bool,
pub build: bool,
pub no_binary: Option<Vec<PackageNameSpecifier>>,
pub only_binary: Option<Vec<PackageNameSpecifier>>,
pub python_version: Option<PythonVersion>,
pub python_platform: Option<TargetTriple>,
pub universal: bool,
pub no_universal: bool,
pub no_emit_package: Option<Vec<PackageName>>,
pub emit_index_url: bool,
pub no_emit_index_url: bool,
pub emit_find_links: bool,
pub no_emit_find_links: bool,
pub emit_build_options: bool,
pub no_emit_build_options: bool,
pub emit_marker_expression: bool,
pub no_emit_marker_expression: bool,
pub emit_index_annotation: bool,
pub no_emit_index_annotation: bool,
pub torch_backend: Option<TorchMode>,
pub compat_args: PipCompileCompatArgs,
}Fields§
§src_file: Vec<PathBuf>Include 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.
If a pyproject.toml, setup.py, or setup.cfg file is provided, uv will extract the
requirements for the relevant project.
If - is provided, then requirements will be read from stdin.
The order of the requirements files and the requirements in them is used to determine priority during resolution.
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. However, including a package in a constraints file will not
trigger the installation of that package.
This is equivalent to pip’s --constraint option.
overrides: Vec<Maybe<PathBuf>>Override versions using the given requirements files.
Overrides files are requirements.txt-like files that force a specific version of a
requirement to be installed, regardless of the requirements declared by any constituent
package, and regardless of whether this would be considered an invalid resolution.
While constraints are additive, in that they’re combined with the requirements of the constituent packages, overrides are absolute, in that they completely replace the requirements of the constituent packages.
excludes: Vec<Maybe<PathBuf>>Exclude packages from resolution using the given requirements files.
Excludes files are requirements.txt-like files that specify packages to exclude
from the resolution. When a package is excluded, it will be omitted from the
dependency list entirely and its own dependencies will be ignored during the resolution
phase. Excludes are unconditional in that requirement specifiers and markers are ignored;
any package listed in the provided file will be omitted from all resolved environments.
build_constraints: Vec<Maybe<PathBuf>>Constrain build dependencies using the given requirements files when building source distributions.
Constraints files are requirements.txt-like files that only control the version of a
requirement that’s installed. However, including a package in a constraints file will not
trigger the installation of that package.
extra: Option<Vec<ExtraName>>Include optional dependencies from the specified extra name; may be provided more than once.
Only applies to pyproject.toml, setup.py, and setup.cfg sources.
all_extras: boolInclude all optional dependencies.
Only applies to pyproject.toml, setup.py, and setup.cfg sources.
no_all_extras: bool§group: Vec<PipGroupName>Install the specified dependency group from a pyproject.toml.
If no path is provided, the pyproject.toml in the working directory is used.
May be provided multiple times.
resolver: ResolverArgs§refresh: RefreshArgs§no_deps: boolIgnore package dependencies, instead only add those packages explicitly listed on the command line to the resulting requirements file.
deps: bool§output_file: Option<PathBuf>Write the compiled requirements to the given requirements.txt or pylock.toml file.
If the file already exists, the existing versions will be preferred when resolving
dependencies, unless --upgrade is also specified.
format: Option<PipCompileFormat>The format in which the resolution should be output.
Supports both requirements.txt and pylock.toml (PEP 751) output formats.
uv will infer the output format from the file extension of the output file, if
provided. Otherwise, defaults to requirements.txt.
no_strip_extras: boolInclude extras in the output file.
By default, uv strips extras, as any packages pulled in by the extras are already included
as dependencies in the output file directly. Further, output files generated with
--no-strip-extras cannot be used as constraints files in install and sync invocations.
strip_extras: bool§no_strip_markers: boolInclude environment markers in the output file.
By default, uv strips environment markers, as the resolution generated by compile is
only guaranteed to be correct for the target environment.
strip_markers: bool§no_annotate: boolExclude comment annotations indicating the source of each package.
annotate: bool§no_header: boolExclude the comment header at the top of the generated output file.
header: bool§annotation_style: Option<AnnotationStyle>The style of the annotation comments included in the output file, used to indicate the source of each package.
Defaults to split.
custom_compile_command: Option<String>The header comment to include at the top of the output file generated by uv pip compile.
Used to reflect custom build scripts and commands that wrap uv pip compile.
python: Option<Maybe<String>>The Python interpreter to use during resolution.
A Python interpreter is required for building source distributions to determine package metadata when there are not wheels.
The interpreter is also used to determine the default minimum Python version, unless
--python-version is provided.
This option respects UV_PYTHON, but when set via environment variable, it is overridden
by --python-version.
See uv help python for details on Python discovery and supported request formats.
system: boolInstall packages into the system Python environment.
By default, uv uses the virtual environment in the current working directory or any parent
directory, falling back to searching for a Python executable in PATH. The --system
option instructs uv to avoid using a virtual environment Python and restrict its search to
the system path.
no_system: bool§generate_hashes: boolInclude distribution hashes in the output file.
no_generate_hashes: bool§no_build: boolDon’t build source distributions.
When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.
Alias for --only-binary :all:.
build: bool§no_binary: Option<Vec<PackageNameSpecifier>>Don’t install pre-built wheels.
The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.
Multiple packages may be provided. Disable binaries for all packages with :all:.
Clear previously specified packages with :none:.
only_binary: Option<Vec<PackageNameSpecifier>>Only use pre-built wheels; don’t build source distributions.
When enabled, resolving will not run code from the given packages. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.
Multiple packages may be provided. Disable binaries for all packages with :all:.
Clear previously specified packages with :none:.
python_version: Option<PythonVersion>The Python version to use for resolution.
For example, 3.8 or 3.8.17.
Defaults to the version of the Python interpreter used for resolution.
Defines the minimum Python version that must be supported by the resolved requirements.
If a patch version is omitted, the minimum patch version is assumed. For
example, 3.8 is mapped to 3.8.0.
python_platform: Option<TargetTriple>The platform for which requirements should be resolved.
Represented as a “target triple”, a string that describes the target platform in terms of
its CPU, vendor, and operating system name, like x86_64-unknown-linux-gnu or
aarch64-apple-darwin.
When targeting macOS (Darwin), the default minimum version is 13.0. Use
MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.
When targeting iOS, the default minimum version is 13.0. Use
IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.
When targeting Android, the default minimum Android API level is 24. Use
ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.
universal: boolPerform a universal resolution, attempting to generate a single requirements.txt output
file that is compatible with all operating systems, architectures, and Python
implementations.
In universal mode, the current Python version (or user-provided --python-version) will be
treated as a lower bound. For example, --universal --python-version 3.7 would produce a
universal resolution for Python 3.7 and later.
Implies --no-strip-markers.
no_universal: bool§no_emit_package: Option<Vec<PackageName>>Specify a package to omit from the output resolution. Its dependencies will still be
included in the resolution. Equivalent to pip-compile’s --unsafe-package option.
emit_index_url: boolInclude --index-url and --extra-index-url entries in the generated output file.
no_emit_index_url: bool§emit_find_links: boolInclude --find-links entries in the generated output file.
no_emit_find_links: bool§emit_build_options: boolInclude --no-binary and --only-binary entries in the generated output file.
no_emit_build_options: bool§emit_marker_expression: boolWhether to emit a marker string indicating when it is known that the resulting set of pinned dependencies is valid.
The pinned dependencies may be valid even when the marker expression is false, but when the expression is true, the requirements are known to be correct.
no_emit_marker_expression: bool§emit_index_annotation: boolInclude comment annotations indicating the index used to resolve each package (e.g.,
# from https://pypi.org/simple).
no_emit_index_annotation: bool§torch_backend: Option<TorchMode>The backend to use when fetching packages in the PyTorch ecosystem (e.g., cpu, cu126, or auto).
When set, uv will ignore the configured index URLs for packages in the PyTorch ecosystem, and will instead use the defined backend.
For example, when set to cpu, uv will use the CPU-only PyTorch index; when set to cu126,
uv will use the PyTorch index for CUDA 12.6.
The auto mode will attempt to detect the appropriate PyTorch index based on the currently
installed CUDA drivers.
This option is in preview and may change in any future release.
compat_args: PipCompileCompatArgsTrait Implementations§
Source§impl Args for PipCompileArgs
impl Args for PipCompileArgs
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 PipCompileArgs
impl FromArgMatches for PipCompileArgs
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 PipCompileArgs
impl RefUnwindSafe for PipCompileArgs
impl Send for PipCompileArgs
impl Sync for PipCompileArgs
impl Unpin for PipCompileArgs
impl UnwindSafe for PipCompileArgs
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