Skip to content

Commit 393f119

Browse files
authored
fix: use correct python command (#230)
1 parent 53cce23 commit 393f119

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

lib/dependencies/inspect-implementation.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,14 @@ function dumpAllFilesInTempDir(tempDirName: string) {
211211
async function updateSetuptools(
212212
setuptoolsVersion: string,
213213
dir: string,
214-
pythonEnv
214+
pythonEnv,
215+
command: string
215216
) {
216217
// For python 3.12, setuptools needs to be updated
217218
// due to removal of some deprecated packages
218219
// see: https://github.com/pypa/pip/pull/11997
219220

220-
const pythonVersion = await subProcess.execute(`python`, ['--version'], {
221+
const pythonVersion = await subProcess.execute(command, ['--version'], {
221222
cwd: dir,
222223
env: pythonEnv,
223224
});
@@ -226,10 +227,14 @@ async function updateSetuptools(
226227
return;
227228
}
228229

229-
await subProcess.execute(`pip install setuptools==${setuptoolsVersion}`, [], {
230-
cwd: dir,
231-
env: pythonEnv,
232-
});
230+
await subProcess.execute(
231+
`${command} -m pip install setuptools==${setuptoolsVersion}`,
232+
[],
233+
{
234+
cwd: dir,
235+
env: pythonEnv,
236+
}
237+
);
233238
}
234239

235240
export async function inspectInstalledDeps(
@@ -251,7 +256,12 @@ export async function inspectInstalledDeps(
251256
try {
252257
const pythonEnv = getPythonEnv(targetFile);
253258

254-
await updateSetuptools(UPDATED_SETUPTOOLS_VERSION, root, pythonEnv);
259+
await updateSetuptools(
260+
UPDATED_SETUPTOOLS_VERSION,
261+
root,
262+
pythonEnv,
263+
command
264+
);
255265

256266
// See ../../pysrc/README.md
257267
const output = await subProcess.execute(

test/system/inspect.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe('inspect', () => {
159159
{
160160
pkg: {
161161
name: 's3transfer',
162-
version: '0.8.2',
162+
version: '0.9.0',
163163
},
164164
directDeps: ['awss'],
165165
},

0 commit comments

Comments
 (0)