pub struct Installer {
pub config: InstallConfig,
/* private fields */
}Expand description
Stateful installation context. The located uv/micromamba/Conda executables and selected Torch backend are cached across recipes in one run.
Fields§
§config: InstallConfigImplementations§
Source§impl Installer
impl Installer
pub fn new(root: impl Into<PathBuf>) -> Self
Sourcepub fn from_environment(root: impl Into<PathBuf>) -> Result<Self, InstallError>
pub fn from_environment(root: impl Into<PathBuf>) -> Result<Self, InstallError>
Construct an installer using the compatibility environment variables documented by the original Molchanica and bio_web installers.
Sourcepub fn for_process_executables(
root: impl Into<PathBuf>,
) -> Result<Self, InstallError>
pub fn for_process_executables( root: impl Into<PathBuf>, ) -> Result<Self, InstallError>
Construct an installer for the shared process_executables/python_envs layout.
Examples found in repository?
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let mut installer = Installer::for_process_executables("process_executables")?;
5 installer.install(Tool::OpenDde)?;
6
7 // Independent recipes continue after an upstream failure.
8 let report = installer.install_many([Tool::Boltz2, Tool::ProteinMpnn]);
9 for failure in &report.failed {
10 eprintln!("{}: {}", failure.tool.name(), failure.error);
11 }
12
13 // Status: `status_quick` inspects markers, executables, and required assets
14 // without launching the tool; `status_full` also runs its help/version probe.
15 let status = installer.status_quick(Tool::OpenDde);
16 println!("{:?}: {}", status.result, status.detail);
17
18 let report = installer.uninstall(Tool::OpenDde)?;
19 println!("Removed {} paths", report.removed.len());
20 Ok(())
21}pub fn from_config(config: InstallConfig) -> Self
pub fn with_reporter( self, reporter: impl Fn(InstallEvent) + Send + Sync + 'static, ) -> Self
pub fn environment_path(&self, tool: Tool) -> PathBuf
Sourcepub fn executable_path(&self, tool: Tool) -> PathBuf
pub fn executable_path(&self, tool: Tool) -> PathBuf
Locate a tool’s installed console entry point in its managed environment.
Sourcepub fn tool_command(&self, tool: Tool) -> CommandSpec
pub fn tool_command(&self, tool: Tool) -> CommandSpec
Build a command for a tool’s console entry point in its managed environment.
The child receives VIRTUAL_ENV and a PATH whose first directory is the
tool environment’s scripts directory. This is equivalent to activating the
environment before running its console script, and lets dependencies such
as PyTorch find helper executables installed beside the script.
Sourcepub fn tool_python_command(&self, tool: Tool) -> CommandSpec
pub fn tool_python_command(&self, tool: Tool) -> CommandSpec
Build a command for the managed Python interpreter of a tool.
pub fn tools_root(&self) -> &Path
Sourcepub fn install(&mut self, tool: Tool) -> Result<(), InstallError>
pub fn install(&mut self, tool: Tool) -> Result<(), InstallError>
Install or refresh one tool. Recipes are designed to be safely rerunnable.
Examples found in repository?
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let mut installer = Installer::for_process_executables("process_executables")?;
5 installer.install(Tool::OpenDde)?;
6
7 // Independent recipes continue after an upstream failure.
8 let report = installer.install_many([Tool::Boltz2, Tool::ProteinMpnn]);
9 for failure in &report.failed {
10 eprintln!("{}: {}", failure.tool.name(), failure.error);
11 }
12
13 // Status: `status_quick` inspects markers, executables, and required assets
14 // without launching the tool; `status_full` also runs its help/version probe.
15 let status = installer.status_quick(Tool::OpenDde);
16 println!("{:?}: {}", status.result, status.detail);
17
18 let report = installer.uninstall(Tool::OpenDde)?;
19 println!("Removed {} paths", report.removed.len());
20 Ok(())
21}Sourcepub fn status_quick(&self, tool: Tool) -> ToolStatus
pub fn status_quick(&self, tool: Tool) -> ToolStatus
Inspect an installed tool without launching its application code.
Examples found in repository?
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let mut installer = Installer::for_process_executables("process_executables")?;
5 installer.install(Tool::OpenDde)?;
6
7 // Independent recipes continue after an upstream failure.
8 let report = installer.install_many([Tool::Boltz2, Tool::ProteinMpnn]);
9 for failure in &report.failed {
10 eprintln!("{}: {}", failure.tool.name(), failure.error);
11 }
12
13 // Status: `status_quick` inspects markers, executables, and required assets
14 // without launching the tool; `status_full` also runs its help/version probe.
15 let status = installer.status_quick(Tool::OpenDde);
16 println!("{:?}: {}", status.result, status.detail);
17
18 let report = installer.uninstall(Tool::OpenDde)?;
19 println!("Removed {} paths", report.removed.len());
20 Ok(())
21}Sourcepub fn status_full(&self, tool: Tool) -> ToolStatus
pub fn status_full(&self, tool: Tool) -> ToolStatus
Launch an installed tool’s status probe and inspect its compute device.
Sourcepub fn status(&self, tool: Tool) -> ToolStatus
pub fn status(&self, tool: Tool) -> ToolStatus
Backwards-compatible alias for Installer::status_full.
Sourcepub fn list_quick(&self) -> Vec<(Tool, ToolStatus)>
pub fn list_quick(&self) -> Vec<(Tool, ToolStatus)>
Quickly inspect every tool installed by this crate.
Sourcepub fn list_full(&self) -> Vec<(Tool, ToolStatus)>
pub fn list_full(&self) -> Vec<(Tool, ToolStatus)>
Fully probe every tool installed by this crate.
Sourcepub fn list(&self) -> Vec<(Tool, ToolStatus)>
pub fn list(&self) -> Vec<(Tool, ToolStatus)>
Backwards-compatible alias for Installer::list_full.
Sourcepub fn uninstall(&mut self, tool: Tool) -> Result<UninstallReport, InstallError>
pub fn uninstall(&mut self, tool: Tool) -> Result<UninstallReport, InstallError>
Remove one tool’s environment, assets, and installation marker.
Rerunnable in the same sense the recipes are: a tool that is already absent uninstalls successfully with an empty report, which is what makes this safe to offer as a button beside a status that may be a few minutes stale.
Examples found in repository?
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let mut installer = Installer::for_process_executables("process_executables")?;
5 installer.install(Tool::OpenDde)?;
6
7 // Independent recipes continue after an upstream failure.
8 let report = installer.install_many([Tool::Boltz2, Tool::ProteinMpnn]);
9 for failure in &report.failed {
10 eprintln!("{}: {}", failure.tool.name(), failure.error);
11 }
12
13 // Status: `status_quick` inspects markers, executables, and required assets
14 // without launching the tool; `status_full` also runs its help/version probe.
15 let status = installer.status_quick(Tool::OpenDde);
16 println!("{:?}: {}", status.result, status.detail);
17
18 let report = installer.uninstall(Tool::OpenDde)?;
19 println!("Removed {} paths", report.removed.len());
20 Ok(())
21}Sourcepub fn install_many(
&mut self,
tools: impl IntoIterator<Item = Tool>,
) -> InstallReport
pub fn install_many( &mut self, tools: impl IntoIterator<Item = Tool>, ) -> InstallReport
Install several tools without letting one broken upstream release suppress the rest.
Examples found in repository?
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let mut installer = Installer::for_process_executables("process_executables")?;
5 installer.install(Tool::OpenDde)?;
6
7 // Independent recipes continue after an upstream failure.
8 let report = installer.install_many([Tool::Boltz2, Tool::ProteinMpnn]);
9 for failure in &report.failed {
10 eprintln!("{}: {}", failure.tool.name(), failure.error);
11 }
12
13 // Status: `status_quick` inspects markers, executables, and required assets
14 // without launching the tool; `status_full` also runs its help/version probe.
15 let status = installer.status_quick(Tool::OpenDde);
16 println!("{:?}: {}", status.result, status.detail);
17
18 let report = installer.uninstall(Tool::OpenDde)?;
19 println!("Removed {} paths", report.removed.len());
20 Ok(())
21}