Skip to content

Commit

Permalink
Merge pull request #199 from aminya/setup-python-bundle [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Sep 8, 2023
2 parents ffff3ab + 96396ce commit 4ca8d58
Show file tree
Hide file tree
Showing 27 changed files with 65 additions and 62 deletions.
7 changes: 0 additions & 7 deletions dist/actions/actions_python.3d3da518.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/actions/actions_python.3d3da518.js.map

This file was deleted.

3 changes: 3 additions & 0 deletions dist/actions/actions_python.e89dee1a.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/actions/actions_python.e89dee1a.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/actions/cache-dependencies.a31532a6.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/actions/cache-dependencies.a31532a6.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/actions/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/actions/setup-cpp.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/legacy/actions_python.3180bacb.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/legacy/actions_python.3180bacb.js.map

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions dist/legacy/actions_python.7ea72d9b.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/legacy/actions_python.7ea72d9b.js.map

This file was deleted.

6 changes: 6 additions & 0 deletions dist/legacy/cache-dependencies.348a592e.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/legacy/cache-dependencies.348a592e.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/modern/actions_python.3b8537b9.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/modern/actions_python.3b8537b9.js.map

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions dist/modern/actions_python.ff232e32.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/modern/actions_python.ff232e32.js.map

This file was deleted.

6 changes: 6 additions & 0 deletions dist/modern/cache-dependencies.e0061047.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/modern/cache-dependencies.e0061047.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"prettier-config-atomic": "^3.1.0",
"retry-as-promised": "^7.0.4",
"semver": "7.5.4",
"setup-python": "github:actions/setup-python#v4.7.0",
"setup-python": "github:aminya/setup-python#a783db655c6e40317e2c0c96f9d162d9c9f4a751",
"shx": "0.3.4",
"simple-update-notifier": "^2.0.0",
"terser-config-atomic": "^1.0.0",
Expand Down
40 changes: 20 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 5 additions & 11 deletions src/python/actions_python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,13 @@ import { info, warning } from "ci-log"
import { debug } from "@actions/core"
import { join } from "patha"
import { GITHUB_ACTIONS } from "ci-info"
import { isCacheFeatureAvailable, IS_MAC } from "setup-python/src/utils"
import { getCacheDistributor } from "setup-python/src/cache-distributions/cache-factory"
import { IS_MAC } from "setup-python/src/utils"
import { pathExists } from "path-exists"

function isPyPyVersion(versionSpec: string) {
return versionSpec.startsWith("pypy")
}

export async function cacheDependencies(cache: string, pythonVersion: string) {
const cacheDependencyPath = undefined
const cacheDistributor = getCacheDistributor(cache, pythonVersion, cacheDependencyPath)
await cacheDistributor.restoreCache()
}

const checkLatest = false

export async function setupActionsPython(version: string, _setupDir: string, arch: string) {
Expand All @@ -45,9 +38,10 @@ export async function setupActionsPython(version: string, _setupDir: string, arc
info(`Successfully set up ${installed.impl} (${pythonVersion})`)
}

if (isCacheFeatureAvailable()) {
const cache = "pip" // package manager used for caching
await cacheDependencies(cache, pythonVersion)
const cache = false
if (cache) {
const { cacheDependencies } = await import("setup-python/src/cache-dependencies")
await cacheDependencies("pip", pythonVersion)
}
}

Expand Down

0 comments on commit 4ca8d58

Please sign in to comment.