Compare commits
No commits in common. "main" and "v4.1" have entirely different histories.
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
|
||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
name: Test the action
|
||||
steps:
|
||||
|
@ -32,7 +32,7 @@ This action supports the following inputs:
|
||||
| -------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `python-version` | Not specified | Version range or exact version of a Python version to use, using SemVer's version range syntax. |
|
||||
| `python-version-file` | `pyproject.toml` | File containing the Python version to use. Example: .`python-version` |
|
||||
| `architecture` | `x64` | The target architecture (x86, x64, arm64) of the Python interpreter. |
|
||||
| `architecture` | `x64` | The target architecture (x86, x64) of the Python interpreter. |
|
||||
| `allow-python-prereleases` | `false` | Allow prerelease versions of Python to be installed. |
|
||||
| `token` | `${{ github.token }}` | Used to pull python distributions from actions/python-versions. Since there's a default, this is typically not supplied by the user. |
|
||||
| `version` | Not specified | The version of PDM to install, or 'head' to install from the main branch. |
|
||||
|
@ -8,7 +8,7 @@ inputs:
|
||||
python-version-file:
|
||||
description: 'File containing the Python version to use. Example: .python-version'
|
||||
architecture:
|
||||
description: 'The target architecture (x86, x64, arm64) of the Python interpreter.'
|
||||
description: 'The target architecture (x86, x64) of the Python interpreter.'
|
||||
required: false
|
||||
allow-python-prereleases:
|
||||
description: Allow prerelease versions of Python to be installed.
|
||||
@ -37,12 +37,6 @@ inputs:
|
||||
description: The dependency file(s) to cache.
|
||||
default: pdm.lock
|
||||
required: false
|
||||
cache-restore-exact-match:
|
||||
description: >
|
||||
Restore cache ONLY on exact match with the primary key.
|
||||
Note: Post-installation cache will still be saved if cache is 'true'.
|
||||
default: 'false'
|
||||
required: false
|
||||
update-python:
|
||||
description: Whether to update the environment with the requested Python
|
||||
default: 'true'
|
||||
|
58390
dist/cache-save.js
vendored
58390
dist/cache-save.js
vendored
File diff suppressed because one or more lines are too long
63484
dist/setup-pdm.js
vendored
63484
dist/setup-pdm.js
vendored
File diff suppressed because one or more lines are too long
@ -14,7 +14,7 @@
|
||||
"lint:fix": "eslint . --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/cache": "^4.0.3",
|
||||
"@actions/cache": "^3.2.3",
|
||||
"@actions/core": "^1.10.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/glob": "^0.4.0",
|
||||
|
11
pdm.lock
generated
11
pdm.lock
generated
@ -3,12 +3,9 @@
|
||||
|
||||
[metadata]
|
||||
groups = ["default", "dev"]
|
||||
strategy = ["inherit_metadata"]
|
||||
lock_version = "4.5.0"
|
||||
content_hash = "sha256:c7bc8c77abe4c890545158d7bfdd811dce4a2658fa8ab856aa152f869973efab"
|
||||
|
||||
[[metadata.targets]]
|
||||
requires_python = ">=3.9"
|
||||
strategy = ["cross_platform", "inherit_metadata"]
|
||||
lock_version = "4.4.1"
|
||||
content_hash = "sha256:eb061d39de14e94263f38ecb20461dfb8a9fc7d73a3f9ede85ded6085701598a"
|
||||
|
||||
[[package]]
|
||||
name = "certifi"
|
||||
@ -63,7 +60,7 @@ version = "2.1.0"
|
||||
requires_python = ">=3.8"
|
||||
summary = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||
groups = ["dev"]
|
||||
marker = "python_version == \"3.13\""
|
||||
marker = "python_version == \"3.8\""
|
||||
files = [
|
||||
{file = "urllib3-2.1.0-py3-none-any.whl", hash = "sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3"},
|
||||
{file = "urllib3-2.1.0.tar.gz", hash = "sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54"},
|
||||
|
2849
pnpm-lock.yaml
generated
2849
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
name = "setup-pdm"
|
||||
version = "0.0.0"
|
||||
authors = [ { name = "Frost Ming", email = "mianghong@gmail.com" }, ]
|
||||
requires-python = ">=3.9"
|
||||
requires-python = ">=3.8"
|
||||
license = { text = "MIT" }
|
||||
|
||||
[tool.pdm]
|
||||
@ -10,9 +10,9 @@ distribution = false
|
||||
|
||||
[tool.pdm.dev-dependencies]
|
||||
dev = [
|
||||
"urllib3; python_version=='3.8'",
|
||||
"certifi; python_version=='3.9'",
|
||||
"pytz; python_version=='3.10'",
|
||||
"setuptools; python_version=='3.11'",
|
||||
"six; python_version=='3.12'",
|
||||
"urllib3; python_version=='3.13'",
|
||||
]
|
||||
|
@ -7,14 +7,8 @@ import { getOutput } from './utils'
|
||||
|
||||
async function calculateCacheKeys(pythonVersion: string, cacheDependencyPath: string): Promise<{ primaryKey: string, restoreKeys: string[] }> {
|
||||
const hash = await hashFiles(cacheDependencyPath)
|
||||
const primaryKey = `setup-pdm-${process.env.RUNNER_OS}-${process.env.RUNNER_ARCH}-python-${pythonVersion}-${hash}`
|
||||
const restoreKey = `setup-pdm-${process.env.RUNNER_OS}-${process.env.RUNNER_ARCH}-python-${pythonVersion}-`
|
||||
|
||||
const restoreExactMatch = core.getBooleanInput('cache-restore-exact-match')
|
||||
if (restoreExactMatch) {
|
||||
return { primaryKey, restoreKeys: [] }
|
||||
}
|
||||
|
||||
const primaryKey = `setup-pdm-${process.env.RUNNER_OS}-python-${pythonVersion}-${hash}`
|
||||
const restoreKey = `setup-pdm-${process.env.RUNNER_OS}-python-${pythonVersion}-`
|
||||
return { primaryKey, restoreKeys: [restoreKey] }
|
||||
}
|
||||
|
||||
|
@ -41,27 +41,22 @@ async function run(): Promise<void> {
|
||||
cmdArgs.push('-o', 'install-output.json')
|
||||
// Use the default python version installed with the runner
|
||||
try {
|
||||
const installedPython = await utils.findPythonVersion(pythonVersion, arch, allowPythonPreReleases, updateEnvironment)
|
||||
|
||||
if (process.platform === 'linux') {
|
||||
// See https://github.com/actions/virtual-environments/issues/2803
|
||||
if (process.arch === 'x64') {
|
||||
core.exportVariable('LD_PRELOAD', '/lib/x86_64-linux-gnu/libgcc_s.so.1')
|
||||
}
|
||||
else if (process.arch === 'arm64') {
|
||||
core.exportVariable('LD_PRELOAD', '/lib/aarch64-linux-gnu/libgcc_s.so.1')
|
||||
}
|
||||
}
|
||||
await exec(IS_WINDOWS ? 'python' : 'python3', cmdArgs, { input: await utils.fetchUrlAsBuffer(INSTALL_SCRIPT_URL) })
|
||||
const installOutput: InstallOutput = JSON.parse(await utils.readFile('install-output.json'))
|
||||
core.debug(`Install output: ${installOutput}`)
|
||||
core.info(`Successfully setup ${installOutput.pdm_version} with Python ${installedPython}`)
|
||||
core.setOutput('pdm-version', installOutput.pdm_version)
|
||||
core.setOutput('pdm-bin', path.join(installOutput.install_location, installOutput.pdm_bin))
|
||||
core.addPath(path.dirname(installOutput.pdm_bin))
|
||||
if (core.getBooleanInput('enable-pep582'))
|
||||
core.exportVariable('PYTHONPATH', getPep582Path(installOutput.install_location, installOutput.install_python_version))
|
||||
|
||||
const installedPython = await utils.findPythonVersion(pythonVersion, arch, allowPythonPreReleases, updateEnvironment)
|
||||
|
||||
if (process.platform === 'linux') {
|
||||
// See https://github.com/actions/virtual-environments/issues/2803
|
||||
core.exportVariable('LD_PRELOAD', '/lib/x86_64-linux-gnu/libgcc_s.so.1')
|
||||
}
|
||||
core.info(`Successfully setup ${installOutput.pdm_version} with Python ${installedPython}`)
|
||||
const matchersPath = path.join(__dirname, '..', '.github')
|
||||
core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`)
|
||||
if (utils.isCacheAvailable())
|
||||
|
Loading…
x
Reference in New Issue
Block a user