Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Use only shims.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jun 16, 2024
1 parent 37e6465 commit 338c810
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ pub fn locate_executables(
}

// Create a secondary executable that includes the major version as a suffix
// https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html#no-pip-exe-on-windows
let secondary = HashMap::from_iter([
// python3
(
Expand All @@ -189,15 +190,20 @@ pub fn locate_executables(
// pip
(
format!("pip"),
ExecutableConfig::new(env.os.get_file_name(format!("{scripts_dir}/pip"), "exe")),
ExecutableConfig {
no_bin: true,
shim_before_args: Some(StringOrVec::Vec(vec!["-m".into(), "pip".into()])),
..ExecutableConfig::default()
},
),
// pip3
(
format!("pip{major_version}"),
ExecutableConfig::new(
env.os
.get_file_name(format!("{scripts_dir}/pip{major_version}"), "exe"),
),
ExecutableConfig {
no_bin: true,
shim_before_args: Some(StringOrVec::Vec(vec!["-m".into(), "pip".into()])),
..ExecutableConfig::default()
},
),
]);

Expand Down
7 changes: 7 additions & 0 deletions tests/snapshots/shims_test__creates_shims.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ expression: "std::fs::read_to_string(sandbox.path().join(\".proto/shims/registry
"pip"
]
},
"pip3": {
"parent": "python-test",
"before_args": [
"-m",
"pip"
]
},
"python-test": {},
"python-test3": {
"alt_bin": true,
Expand Down

0 comments on commit 338c810

Please sign in to comment.