Split virtual environment detection into a dedicated module (#3331)

Split out of https://github.com/astral-sh/uv/pull/3266
This commit is contained in:
Zanie Blue 2024-05-02 06:58:48 -05:00 committed by GitHub
parent c28a2806b3
commit 49675558eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 171 additions and 152 deletions

View file

@ -17,7 +17,7 @@ use pypi_types::Scheme;
use uv_cache::{Cache, CacheBucket, CachedByTimestamp, Freshness, Timestamp};
use uv_fs::{write_atomic_sync, PythonExt, Simplified};
use crate::{Error, PythonVersion, Target, Virtualenv};
use crate::{Error, PythonVersion, Target, VirtualEnvironment};
/// A Python executable and its associated platform markers.
#[derive(Debug, Clone)]
@ -98,7 +98,7 @@ impl Interpreter {
/// Return a new [`Interpreter`] with the given virtual environment root.
#[must_use]
pub fn with_virtualenv(self, virtualenv: Virtualenv) -> Self {
pub fn with_virtualenv(self, virtualenv: VirtualEnvironment) -> Self {
Self {
scheme: virtualenv.scheme,
sys_executable: virtualenv.executable,