Skip to content

Commit debc509

Browse files
Add GitHub Action for Python setup
This YAML file sets up a GitHub Action for configuring a specific version of Python, including various inputs and outputs for managing dependencies and environment variables. Signed-off-by: Fabiana ⚡️ Campanari <[email protected]>
1 parent df2ba46 commit debc509

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

setup-python.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
3+
4+
5+
---
6+
name: "Setup Python"
7+
description: "Set up a specific version of Python and add the command-line tools to the PATH."
8+
author: "GitHub"
9+
inputs:
10+
python-version:
11+
description: "Version range or exact version of Python or PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset."
12+
python-version-file:
13+
description: "File containing the Python version to use. Example: .python-version"
14+
cache:
15+
description: "Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry."
16+
required: false
17+
architecture:
18+
description: "The target architecture (x86, x64) of the Python or PyPy interpreter."
19+
check-latest:
20+
description: "Set this option if you want the action to check for the latest available version that satisfies the version spec."
21+
default: false
22+
token:
23+
description: "The token used to authenticate when fetching Python distributions from https://github.com/actions/python-versions. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting."
24+
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
25+
cache-dependency-path:
26+
description: "Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies."
27+
update-environment:
28+
description: "Set this option if you want the action to update environment variables."
29+
default: true
30+
allow-prereleases:
31+
description: "When 'true', a version range passed to 'python-version' input will match prerelease versions if no GA versions are found. Only 'x.y' version range is supported for CPython."
32+
default: false
33+
outputs:
34+
python-version:
35+
description: "The installed Python or PyPy version. Useful when given a version range as input."
36+
cache-hit:
37+
description: "A boolean value to indicate a cache entry was found"
38+
python-path:
39+
description: "The absolute path to the Python or PyPy executable."
40+
runs:
41+
using: 'node20'
42+
main: 'dist/setup/index.js'
43+
post: 'dist/cache-save/index.js'
44+
post-if: success()
45+
branding:
46+
icon: 'code'
47+
color: 'yellow'

0 commit comments

Comments
 (0)