Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
34 lines (34 loc) · 1.5 KB
/
Copy pathaction.yml
File metadata and controls
34 lines (34 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Set up Python
description: Install Python with appropriate defaults for NI Python projects.
inputs:
python-version:
default: 3.13.17
outputs:
python-path:
value: ${{ steps.setup-python.outputs.python-path }}
python-version:
value: ${{ steps.setup-python.outputs.python-version }}
runs:
using: composite
steps:
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
id: setup-python
with:
python-version: ${{ inputs.python-version }}
- name: Work around https://github.com/actions/setup-python/issues/1348 - pip is broken after downgrade on Windows pypy-3.11
# For PyPy, actions/setup-python runs "python -m pip install
# --ignore-installed pip". This installs the new pip files on top of the
# old pip files without removing existing files and causes pip to report
# that the old version is installed. Downgrading pip when it's in this
# state tends to break it. To work around this, force-reinstall the latest
# pip.
if: ${{ startsWith(inputs.python-version, 'pypy') }}
run: python -m pip install --upgrade --force-reinstall pip
shell: bash
- name: Add pythonVersion environment variable
run: | # zizmor: ignore[github-env] # value is queried from the installed Python interpreter, not user input
echo "pythonVersion=$PYTHON_VERSION" >> "$GITHUB_ENV"
shell: bash
env:
PYTHON_VERSION: ${{ steps.setup-python.outputs.python-version }}