pub struct Project { /* private fields */ }
Expand description
The pixi project, this main struct to interact with the project. This struct holds the
Manifest
and has functions to modify or request information from it.
This allows in the future to have multiple environments or manifests linked to a project.
Implementations§
source§impl Project
impl Project
sourcepub fn get_metadata_env(&self) -> HashMap<String, String>
pub fn get_metadata_env(&self) -> HashMap<String, String>
Returns environment variables and their values that should be injected when running a command.
source§impl Project
impl Project
sourcepub async fn up_to_date_lock_file(
&self,
options: UpdateLockFileOptions
) -> Result<LockFileDerivedData<'_>>
pub async fn up_to_date_lock_file( &self, options: UpdateLockFileOptions ) -> Result<LockFileDerivedData<'_>>
Ensures that the lock-file is up-to-date with the project information.
Returns the lock-file and any potential derived data that was computed as part of this operation.
source§impl Project
impl Project
sourcepub fn from_manifest(manifest: Manifest) -> Self
pub fn from_manifest(manifest: Manifest) -> Self
Constructs a new instance from an internal manifest representation
sourcepub fn from_str(root: &Path, content: &str) -> Result<Self>
pub fn from_str(root: &Path, content: &str) -> Result<Self>
Constructs a project from a manifest.
sourcepub fn discover() -> Result<Self>
pub fn discover() -> Result<Self>
Discovers the project manifest file in the current directory or any of the parent directories. This will also set the current working directory to the project root.
sourcepub fn manifest_named_source(&self) -> NamedSource<String>
pub fn manifest_named_source(&self) -> NamedSource<String>
Returns the source code of the project as NamedSource
.
Used in error reporting.
sourcepub fn load_or_else_discover(manifest_path: Option<&Path>) -> Result<Self>
pub fn load_or_else_discover(manifest_path: Option<&Path>) -> Result<Self>
Loads a project manifest file or discovers it in the current directory or any of the parent
sourcepub fn description(&self) -> &Option<String>
pub fn description(&self) -> &Option<String>
Returns the description of the project
sourcepub fn environments_dir(&self) -> PathBuf
pub fn environments_dir(&self) -> PathBuf
Returns the environment directory
sourcepub fn solve_group_environments_dir(&self) -> PathBuf
pub fn solve_group_environments_dir(&self) -> PathBuf
Returns the solve group directory
sourcepub fn manifest_path(&self) -> PathBuf
pub fn manifest_path(&self) -> PathBuf
Returns the path to the manifest file.
sourcepub fn lock_file_path(&self) -> PathBuf
pub fn lock_file_path(&self) -> PathBuf
Returns the path to the lock file of the project
sourcepub fn default_environment(&self) -> Environment<'_>
pub fn default_environment(&self) -> Environment<'_>
Returns the default environment of the project.
sourcepub fn environment<Q>(&self, name: &Q) -> Option<Environment<'_>>
pub fn environment<Q>(&self, name: &Q) -> Option<Environment<'_>>
Returns the environment with the given name or None
if no such environment exists.
sourcepub fn environments(&self) -> Vec<Environment<'_>>
pub fn environments(&self) -> Vec<Environment<'_>>
Returns the environments in this project.
sourcepub fn solve_groups(&self) -> Vec<SolveGroup<'_>>
pub fn solve_groups(&self) -> Vec<SolveGroup<'_>>
Returns all the solve groups in the project.
sourcepub fn solve_group(&self, name: &str) -> Option<SolveGroup<'_>>
pub fn solve_group(&self, name: &str) -> Option<SolveGroup<'_>>
Returns the solve group with the given name or None
if no such group exists.
sourcepub fn grouped_environments(&self) -> Vec<GroupedEnvironment<'_>>
pub fn grouped_environments(&self) -> Vec<GroupedEnvironment<'_>>
Return the grouped environments, which are all solve-groups and the environments that need to be solved.
sourcepub fn channels(&self) -> IndexSet<&Channel>
pub fn channels(&self) -> IndexSet<&Channel>
Returns the channels used by this project.
TODO: Remove this function and use the channels from the default environment instead.
sourcepub fn platforms(&self) -> HashSet<Platform>
pub fn platforms(&self) -> HashSet<Platform>
Returns the platforms this project targets
TODO: Remove this function and use the platforms from the default environment instead.
sourcepub fn tasks(&self, platform: Option<Platform>) -> HashMap<&TaskName, &Task>
pub fn tasks(&self, platform: Option<Platform>) -> HashMap<&TaskName, &Task>
Get the tasks of this project
TODO: Remove this function and use the tasks from the default environment instead.
sourcepub fn task_opt(
&self,
name: &TaskName,
platform: Option<Platform>
) -> Option<&Task>
pub fn task_opt( &self, name: &TaskName, platform: Option<Platform> ) -> Option<&Task>
Get the task with the specified name
or None
if no such task exists. If platform
is
specified then the task will first be looked up in the target specific tasks for the given
platform.
TODO: Remove this function and use the task
function from the default environment instead.
sourcepub fn virtual_packages(&self, platform: Platform) -> Vec<GenericVirtualPackage>
pub fn virtual_packages(&self, platform: Platform) -> Vec<GenericVirtualPackage>
TODO: Remove this method and use the one from Environment instead.
sourcepub fn system_requirements(&self) -> SystemRequirements
pub fn system_requirements(&self) -> SystemRequirements
Get the system requirements defined under the system-requirements
section of the project manifest.
They will act as the description of a reference machine which is minimally needed for this package to be run.
TODO: Remove this function and use the system_requirements
function from the default environment instead.
sourcepub fn dependencies(
&self,
kind: Option<SpecType>,
platform: Option<Platform>
) -> Dependencies
pub fn dependencies( &self, kind: Option<SpecType>, platform: Option<Platform> ) -> Dependencies
Returns the dependencies of the project.
TODO: Remove this function and use the dependencies
function from the default environment instead.
sourcepub fn pypi_dependencies(
&self,
platform: Option<Platform>
) -> IndexMap<PackageName, Vec<PyPiRequirement>>
pub fn pypi_dependencies( &self, platform: Option<Platform> ) -> IndexMap<PackageName, Vec<PyPiRequirement>>
Returns the PyPi dependencies of the project
TODO: Remove this function and use the dependencies
function from the default environment instead.
sourcepub fn activation_scripts(&self, platform: Option<Platform>) -> Vec<String>
pub fn activation_scripts(&self, platform: Option<Platform>) -> Vec<String>
Returns the all specified activation scripts that are used in the current platform.
TODO: Remove this function and use the `activation_scripts function from the default environment instead.
sourcepub fn has_pypi_dependencies(&self) -> bool
pub fn has_pypi_dependencies(&self) -> bool
Returns true if the project contains any reference pypi dependencies. Even if just
[pypi-dependencies]
is specified without any requirements this will return true.
sourcepub fn pypi_index_url(&self) -> Url
pub fn pypi_index_url(&self) -> Url
Returns the Python index URLs to use for this project.
sourcepub fn pypi_package_db(&self) -> Result<Arc<PackageDb>>
pub fn pypi_package_db(&self) -> Result<Arc<PackageDb>>
Returns the package database used for caching python metadata, wheels and more. See the
documentation of rip::index::PackageDb
for more information.
sourcepub fn authenticated_client(&self) -> &ClientWithMiddleware
pub fn authenticated_client(&self) -> &ClientWithMiddleware
Create an authenticated reqwest client for this project
use authentication from rattler_networking
source§impl Project
impl Project
pub async fn fetch_sparse_repodata( &self ) -> Result<IndexMap<(Channel, Platform), SparseRepoData>>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl !UnwindSafe for Project
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
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>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§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 more§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§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.