pub struct Venv;Expand description
Adapter for standard Python venv projects.
Trait Implementations§
Source§impl PackageManager for Venv
impl PackageManager for Venv
Source§fn detect(&self, path: &Path) -> bool
fn detect(&self, path: &Path) -> bool
Detect a plain-venv project:
requirements.txtmust exist (otherwise it’s probably not a managed venv project)- At least one directory with
pyvenv.cfgmust exist in the repo root uv.lockmust NOT exist (uv adapter takes priority)
uv’s precedence is also enforced centrally in adapters::detect_adapters, which
covers uv projects declared only through [tool.uv] in pyproject.toml.
Source§fn bloat_dirs(&self, path: &Path) -> Vec<BloatDir>
fn bloat_dirs(&self, path: &Path) -> Vec<BloatDir>
Return all venv directories (any folder containing pyvenv.cfg) as bloat dirs.
Source§fn enforce_lockfile(&self, path: &Path, _policy: EnforcePolicy) -> Result<()>
fn enforce_lockfile(&self, path: &Path, _policy: EnforcePolicy) -> Result<()>
Pure inspection: reads requirements.txt and runs nothing, so neither half of
EnforcePolicy applies.
Source§fn restore(&self, path: &Path) -> Result<()>
fn restore(&self, path: &Path) -> Result<()>
Recreate the environment in .venv.
Note: the adapter prunes any directory containing pyvenv.cfg, whatever it is
called, but restore always recreates .venv — the original folder name is not
recorded anywhere once the directory is gone.
Auto Trait Implementations§
impl Freeze for Venv
impl RefUnwindSafe for Venv
impl Send for Venv
impl Sync for Venv
impl Unpin for Venv
impl UnsafeUnpin for Venv
impl UnwindSafe for Venv
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more