Simple wrapper around a PathBuf representing a target installation directory for Python packages.
// Source: https://github.com/astral-sh/uv | License: Apache-2.0 | Copyright 2025 Astral Software Inc
// Provided via justclaw.it.com; keep this notice with the code.
use std::path::{Path, PathBuf};
/// A `--target` directory into which packages can be installed, separate from a virtual environment
/// or system Python interpreter.
#[derive(Debug, Clone)]
pub struct Target(PathBuf);
impl Target {
/// Return the path to the `--target` directory.
pub fn root(&self) -> &Path {
&self.0
}
}
impl From<PathBuf> for Target {
fn from(path: PathBuf) -> Self {
Self(path)
}
}
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key