Skip to content

Commit 7a9e574

Browse files
committed
Fix missing imports
1 parent 96c0cff commit 7a9e574

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

crates/pet-poetry/src/environment_locations.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use lazy_static::lazy_static;
66
use log::trace;
77
use pet_core::python_environment::PythonEnvironment;
88
use pet_fs::path::norm_case;
9+
use pet_fs::path::resolve_dot_venv;
910
use regex::Regex;
1011
use sha2::{Digest, Sha256};
1112
use std::{
@@ -108,7 +109,7 @@ fn list_all_environments_from_project_config(
108109
// Order of preference is Project (local config) > EnvVariable > Global
109110
if should_use_local_venv_as_poetry_env(global, &local, env) {
110111
// If virtualenvs are in the project, then look for .venv
111-
let venv = resolve_dot_env(path);
112+
let venv = resolve_dot_venv(path);
112113
if venv.is_dir() {
113114
envs.push(venv);
114115
}

crates/pet-uv/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use pet_core::{
1515
Configuration, Locator, LocatorKind, RefreshStatePersistence,
1616
};
1717
use pet_fs::path::norm_case;
18+
use pet_fs::path::resolve_dot_venv;
1819
use pet_python_utils::executable::{find_executable, find_executables};
1920
use serde::Deserialize;
2021

@@ -422,7 +423,7 @@ fn find_workspace_for_project(project_path: &Path) -> Option<PythonEnvironment>
422423
/// Builds a `PythonEnvironment` for a uv workspace root if it has a `.venv` with a valid
423424
/// uv-managed pyvenv.cfg.
424425
fn build_workspace_env(workspace_root: &Path) -> Option<PythonEnvironment> {
425-
let prefix = resolve_dot_env(workspace_root);
426+
let prefix = resolve_dot_venv(workspace_root);
426427
let pyvenv_cfg = prefix.join("pyvenv.cfg");
427428
if !pyvenv_cfg.exists() {
428429
trace!(
@@ -465,8 +466,8 @@ fn list_envs_in_directory(path: &Path) -> Vec<PythonEnvironment> {
465466
let Some(pyproject) = pyproject else {
466467
return envs;
467468
};
468-
let pyvenv_cfg = resolve_dot_env(path).join("pyvenv.cfg");
469-
let prefix = resolve_dot_env(path);
469+
let pyvenv_cfg = resolve_dot_venv(path).join("pyvenv.cfg");
470+
let prefix = resolve_dot_venv(path);
470471
let unix_executable = prefix.join("bin/python");
471472
let windows_executable = prefix.join("Scripts/python.exe");
472473
let executable = if unix_executable.exists() {

crates/pet/src/find.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use pet_core::python_environment::PythonEnvironmentKind;
99
use pet_core::reporter::Reporter;
1010
use pet_core::{Configuration, Locator, LocatorKind};
1111
use pet_env_var_path::get_search_paths_from_env_variables;
12+
use pet_fs::path::resolve_dot_venv;
1213
use pet_global_virtualenvs::list_global_virtual_envs_paths;
1314
use pet_pixi::is_pixi_env;
1415
use pet_python_utils::executable::{
@@ -277,7 +278,7 @@ pub fn find_python_environments_in_workspace_folder_recursive(
277278
// Possible this is a virtual env
278279
workspace_folder.to_path_buf(),
279280
// Optimize for finding these first.
280-
resolve_dot_env(workspace_folder),
281+
resolve_dot_venv(workspace_folder),
281282
workspace_folder.join(".conda"),
282283
workspace_folder.join(".virtualenv"),
283284
workspace_folder.join("venv"),

0 commit comments

Comments
 (0)