mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
56 lines
2.1 KiB
YAML
56 lines
2.1 KiB
YAML
name: Set up reference Python
|
|
description: Install CPython from python-build-standalone with pip available.
|
|
inputs:
|
|
python-version:
|
|
description: CPython version to install
|
|
default: "3.15.0"
|
|
outputs:
|
|
python-path:
|
|
description: Path to the installed interpreter
|
|
value: ${{ steps.python.outputs.python-path }}
|
|
python-version:
|
|
description: Installed CPython version
|
|
value: ${{ steps.python.outputs.python-version }}
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
# uv 0.13.0 includes the final 3.15.0 builds, before setup-python's catalog.
|
|
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
|
|
with:
|
|
version: "0.13.0"
|
|
python-version: ${{ inputs.python-version }}
|
|
activate-environment: true
|
|
no-project: true
|
|
venv-path: ${{ runner.temp }}/reference-python
|
|
enable-cache: false
|
|
env:
|
|
UV_VENV_SEED: "true"
|
|
UV_MANAGED_PYTHON: "true"
|
|
- id: python
|
|
shell: bash
|
|
env:
|
|
REQUESTED_PYTHON: ${{ inputs.python-version }}
|
|
run: |
|
|
python - <<'PY'
|
|
import os
|
|
import platform
|
|
import sys
|
|
|
|
if os.environ["REQUESTED_PYTHON"] == "3.15.0":
|
|
assert sys.version_info[:3] == (3, 15, 0), sys.version
|
|
assert sys.version_info.releaselevel == "final", sys.version
|
|
with open(os.environ["GITHUB_OUTPUT"], "a") as output:
|
|
print(f"python-path={sys.executable}", file=output)
|
|
print(f"python-version={platform.python_version()}", file=output)
|
|
with open(os.environ["GITHUB_ENV"], "a") as env:
|
|
print(f"pythonLocation={sys.base_prefix}", file=env)
|
|
if sys.platform == "linux":
|
|
lib = os.path.join(sys.base_prefix, "lib")
|
|
print(f"LD_LIBRARY_PATH={lib}:{os.environ.get('LD_LIBRARY_PATH', '')}", file=env)
|
|
if sys.platform == "win32":
|
|
with open(os.environ["GITHUB_PATH"], "a") as path:
|
|
print(sys.base_prefix, file=path)
|
|
print(os.path.dirname(sys.executable), file=path)
|
|
print(sys.version)
|
|
PY
|