pub enum InstallLocation<T: Deref<Target = Path>> {
Venv {
venv_base: T,
python_version: (u8, u8),
},
Monotrail {
monotrail_root: T,
python: PathBuf,
python_version: (u8, u8),
},
}
Expand description
Multiplexing between venv install and monotrail install
For monotrail, we have a structure that is {monotrail}/{normalized(name)}/{version}/tag
We use a lockfile to prevent multiple instance writing stuff on the same time
As of pip 22.0, e.g. pip install numpy; pip install numpy; pip install numpy
will
nondeterministically fail
I was also thinking about making a shared lock on the import side, but monotrail install is supposedly atomic (by directory renaming), while for venv installation there can’t be atomicity (we need to add lots of different file without a top level directory / key-turn file we could rename) and the locking would also need to happen in the import mechanism itself to ensure
Variants§
Implementations§
source§impl<T: Deref<Target = Path>> InstallLocation<T>
impl<T: Deref<Target = Path>> InstallLocation<T>
sourcepub fn get_python(&self) -> PathBuf
pub fn get_python(&self) -> PathBuf
Returns the location of the python interpreter
pub fn get_python_version(&self) -> (u8, u8)
sourcepub fn is_installed(&self, normalized_name: &str, version: &str) -> bool
pub fn is_installed(&self, normalized_name: &str, version: &str) -> bool
TODO: This function is unused?