From e8cbeaa301659661a716813b0a55fa86251667e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 19:07:37 +0000 Subject: [PATCH] Use the Windows venv layout in the PyPI fixture hosted_scan_without_a_python_lock_warns_no_lockfile (#1885) fails on the Windows test leg: venv_installed_from_patch_a writes six into lib/python3.11/site-packages, but the Python crawler looks in Lib\site-packages on Windows, so the scan finds nothing and the expected redirect_unconfirmed row never appears. Write the fixture into Lib/site-packages on Windows, the same way run_raw and the workspace fixture in this file already do. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_011f9aeQitp67Dj9pTSDoSHq --- crates/socket-patch-cli/tests/mode_migration_pypi.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/socket-patch-cli/tests/mode_migration_pypi.rs b/crates/socket-patch-cli/tests/mode_migration_pypi.rs index 8a2979eb5..0e35333b4 100644 --- a/crates/socket-patch-cli/tests/mode_migration_pypi.rs +++ b/crates/socket-patch-cli/tests/mode_migration_pypi.rs @@ -912,7 +912,12 @@ const PATCHED_B: &[u8] = b"# six\nVERSION = '1.16.0'\nSOCKET_PATCHED = 2\n"; /// A (`pipenv sync` after the first vendor): its files are A's patched /// bytes, not the pristine release patch B is diffed against. fn venv_installed_from_patch_a(venv: &Path) { - let site = venv.join("lib/python3.11/site-packages"); + // The crawler looks for `Lib\site-packages` in a Windows venv. + let site = venv.join(if cfg!(windows) { + "Lib/site-packages" + } else { + "lib/python3.11/site-packages" + }); let dist = site.join("six-1.16.0.dist-info"); std::fs::create_dir_all(&dist).unwrap(); std::fs::write(site.join("six.py"), PATCHED).unwrap();