Skip to main content

uv_python_managed/
lib.rs

1//! Download, store, inspect, and maintain uv-managed Python installations.
2
3#[cfg(test)]
4use uv_static::EnvVars;
5
6pub use managed::{
7    Error, ManagedPythonInstallation, ManagedPythonInstallations, PythonExecutable,
8    PythonMinorVersionLink, UpgradePolicy, compare_build_versions, create_link_to_executable,
9    platform_key_from_env, python_executable_dir, replace_link_to_executable,
10};
11
12pub mod downloads;
13pub mod macos_dylib;
14mod managed;
15mod sysconfig;
16#[cfg(windows)]
17pub mod windows_registry;
18
19#[cfg(not(test))]
20fn current_dir() -> Result<std::path::PathBuf, std::io::Error> {
21    std::env::current_dir()
22}
23
24#[cfg(test)]
25fn current_dir() -> Result<std::path::PathBuf, std::io::Error> {
26    std::env::var_os(EnvVars::PWD)
27        .map(std::path::PathBuf::from)
28        .map(Ok)
29        .unwrap_or(std::env::current_dir())
30}