@@ -3,14 +3,12 @@ import { addPath } from "../utils/path/addPath"
3
3
import { setupAptPack } from "../utils/setup/setupAptPack"
4
4
import { setupBrewPack } from "../utils/setup/setupBrewPack"
5
5
import { setupChocoPack } from "../utils/setup/setupChocoPack"
6
- import hasha from "hasha"
7
- import { join } from "path"
8
6
import { isGitHubCI } from "../utils/env/isci"
9
7
10
8
export function setupPython ( version : string , setupDir : string , arch : string ) {
11
- if ( ! isGitHubCI ( ) ) {
12
- // TODO parse versoin
13
- return setupPythonViaSystem ( "" , setupDir , arch )
9
+ if ( ! isGitHubCI ( ) || process . platform === "win32" ) {
10
+ // TODO parse version
11
+ return setupPythonViaSystem ( version , setupDir , arch )
14
12
}
15
13
try {
16
14
// eslint-disable-next-line @typescript-eslint/no-var-requires
@@ -21,20 +19,15 @@ export function setupPython(version: string, setupDir: string, arch: string) {
21
19
}
22
20
}
23
21
24
- export async function setupPythonViaSystem ( version : string , setupDir : string , arch : string ) {
22
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
23
+ export async function setupPythonViaSystem ( version : string , setupDir : string , _arch : string ) {
25
24
switch ( process . platform ) {
26
25
case "win32" : {
27
- // Get an unique output directory name from the URL.
28
- const key : string = await hasha . async ( version + arch , { algorithm : "md5" } )
29
- const installDir = join ( setupDir , key , "python" )
30
- const binDir = installDir
31
- await setupChocoPack ( "python3" , version , [ `/InstallDir:${ installDir } ` ] )
32
-
26
+ await setupChocoPack ( "python3" , version , [ `/InstallDir:${ setupDir } ` ] )
33
27
// Adding the bin dir to the path
34
28
/** The directory which the tool is installed to */
35
- activateWinPython ( binDir )
36
-
37
- return { installDir, binDir }
29
+ activateWinPython ( setupDir )
30
+ return { installDir : setupDir , binDir : setupDir }
38
31
}
39
32
case "darwin" : {
40
33
return setupBrewPack ( "python3" , version )
0 commit comments