Skip to content

Commit edaf145

Browse files
authored
setup-python: Downgrade default python-version to 3.13.17 (#109)
* setup-python: Downgrade default Python to 3.13.17 * tests: Add a test for setup-python with default python-version * tests: Rename new test
1 parent 4a10f65 commit edaf145

3 files changed

Lines changed: 40 additions & 2 deletions

File tree

‎.github/workflows/test_actions.yml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,43 @@ jobs:
7070
MATRIX_PYTHON_VERSION: ${{ matrix.python-version }}
7171
OUTPUT_PYTHON_VERSION: ${{ steps.setup-python.outputs.python-version }}
7272

73+
test_setup_python_default_python_version:
74+
name: Test setup-python (default python-version)
75+
runs-on: ${{ matrix.os }}
76+
strategy:
77+
matrix:
78+
os: [windows-latest, ubuntu-latest, macos-latest]
79+
steps:
80+
- name: Check out repo
81+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
82+
with:
83+
persist-credentials: false
84+
- name: Set up Python
85+
id: setup-python
86+
uses: $/setup-python
87+
- name: Check Python version
88+
run: |
89+
import sys, sysconfig, re, os
90+
91+
expected_python_version = os.environ["EXPECTED_PYTHON_VERSION"]
92+
output_python_version = os.environ["OUTPUT_PYTHON_VERSION"]
93+
94+
match = re.search(r"(\d+)\.(\d+)(?:\.(\d+))?", expected_python_version)
95+
expected_version = tuple(int(g) for g in match.groups() if g is not None)
96+
version = sys.version_info[:len(expected_version)]
97+
if version != expected_version:
98+
print(f"::error title=Test Failure::The Python version does not match. Got {version}, expected {expected_version}.")
99+
sys.exit(1)
100+
match = re.search(r"(\d+)\.(\d+)(?:\.(\d+))?", output_python_version)
101+
output_version = tuple(int(g) for g in match.groups() if g is not None)[:len(expected_version)]
102+
if output_version != expected_version:
103+
print(f"::error title=Test Failure::The outputs.python-version version does not match. Got {output_version}, expected {expected_version}.")
104+
sys.exit(1)
105+
shell: python
106+
env:
107+
EXPECTED_PYTHON_VERSION: 3.13.17
108+
OUTPUT_PYTHON_VERSION: ${{ steps.setup-python.outputs.python-version }}
109+
73110
test_setup_poetry:
74111
name: Test setup-poetry
75112
runs-on: ${{ matrix.os }}
@@ -509,6 +546,7 @@ jobs:
509546
runs-on: ubuntu-latest
510547
needs: [
511548
test_setup_python,
549+
test_setup_python_default_python_version,
512550
test_setup_poetry,
513551
test_setup_poetry_cache_hit,
514552
test_setup_poetry_no_cache,

‎setup-python/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The `ni/python-actions/setup-python` action installs Python and adds it to the P
55
It is a thin wrapper for https://github.com/actions/setup-python which is intended to
66
single-source the default Python version for multiple NI Python projects.
77

8-
By default, this action installs Python 3.13.18.
8+
By default, this action installs Python 3.13.17.
99

1010
## Usage
1111

‎setup-python/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Set up Python
22
description: Install Python with appropriate defaults for NI Python projects.
33
inputs:
44
python-version:
5-
default: 3.13.18
5+
default: 3.13.17
66
outputs:
77
python-path:
88
value: ${{ steps.setup-python.outputs.python-path }}

0 commit comments

Comments
 (0)