Skip to content
Merged
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
11 changes: 8 additions & 3 deletions crates/socket-patch-cli/tests/in_process_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1457,9 +1457,14 @@ async fn scan_ignores_ambient_virtual_env() {
mock_batch_empty(&server).await;

let decoy = tempfile::tempdir().unwrap();
let dist_info = decoy
.path()
.join("lib/python3.11/site-packages/decoy_pkg-9.9.9.dist-info");
// The venv layout the Python crawler reads on this platform (Windows
// has no per-version directory), so the decoy is one it would find.
let site_packages = if cfg!(windows) {
decoy.path().join("Lib").join("site-packages")
} else {
decoy.path().join("lib/python3.11/site-packages")
};
let dist_info = site_packages.join("decoy_pkg-9.9.9.dist-info");
std::fs::create_dir_all(&dist_info).unwrap();
std::fs::write(
dist_info.join("METADATA"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,14 @@ async fn agent_scan_names_a_python_project_below_with_its_own_venv() {
std::fs::create_dir_all(root.join(".git")).unwrap();
std::fs::write(root.join(".gitignore"), ".venv/\n").unwrap();
let svc = root.join("svc");
let dist = svc.join(".venv/lib/python3.12/site-packages/six-1.16.0.dist-info");
// The venv layout the Python crawler reads on this platform: Windows
// has no per-version directory.
let site_packages = if cfg!(windows) {
svc.join(".venv").join("Lib").join("site-packages")
} else {
svc.join(".venv/lib/python3.12/site-packages")
};
let dist = site_packages.join("six-1.16.0.dist-info");
std::fs::create_dir_all(&dist).unwrap();
std::fs::write(svc.join(".venv/pyvenv.cfg"), "version = 3.12.0\n").unwrap();
std::fs::write(
Expand Down
Loading