Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 101 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/pet-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub enum LocatorKind {
Pixi,
Poetry,
PyEnv,
Uv,
Venv,
VirtualEnv,
VirtualEnvWrapper,
Expand Down
2 changes: 2 additions & 0 deletions crates/pet-core/src/python_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub enum PythonEnvironmentKind {
MacCommandLineTools,
LinuxGlobal,
MacXCode,
Uv,
UvWorkspace,
Venv,
VirtualEnv,
VirtualEnvWrapper,
Expand Down
11 changes: 10 additions & 1 deletion crates/pet-core/src/pyvenv_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct PyVenvCfg {
pub version_major: u64,
pub version_minor: u64,
pub prompt: Option<String>,
pub file_path: PathBuf,
}

impl PyVenvCfg {
Expand All @@ -31,12 +32,14 @@ impl PyVenvCfg {
version_major: u64,
version_minor: u64,
prompt: Option<String>,
file_path: PathBuf,
) -> Self {
Self {
version,
version_major,
version_minor,
prompt,
file_path,
}
}
pub fn find(path: &Path) -> Option<Self> {
Expand Down Expand Up @@ -126,7 +129,13 @@ fn parse(file: &Path) -> Option<PyVenvCfg> {
}

match (version, version_major, version_minor) {
(Some(ver), Some(major), Some(minor)) => Some(PyVenvCfg::new(ver, major, minor, prompt)),
(Some(ver), Some(major), Some(minor)) => Some(PyVenvCfg::new(
ver,
major,
minor,
prompt,
file.to_path_buf(),
)),
_ => None,
}
}
Expand Down
12 changes: 12 additions & 0 deletions crates/pet-uv/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "pet-uv"
version = "0.1.0"
edition = "2021"
license.workspace = true

[dependencies]
pet-core = { path = "../pet-core" }
pet-python-utils = { path = "../pet-python-utils" }
serde = {version = "1.0.226", features = ["derive"]}
toml = "0.9.7"
log = "0.4.21"
Loading