Skip to content

Commit

Permalink
Add a universal Python version compute step to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz authored Oct 18, 2024
1 parent b302ec3 commit b9e69d5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,31 @@ jobs:
with:
python-version: 3.13-dev
nogil: true
- name: Compute runtime Python version
id: python-install
run: |
import sys
from os import environ
from pathlib import Path
FILE_APPEND_MODE = 'a'
python_version_str = ".".join(
map(str, sys.version_info[:3]),
)
freethreading_suffix = (
'' if sys.version_info < (3, 13) or sys._is_gil_enabled()
else 't'
)
with Path(environ['GITHUB_OUTPUT']).open(
mode=FILE_APPEND_MODE,
) as outputs_file:
print(
f'python-version={python_version_str}{freethreading_suffix}',
file=outputs_file,
)
shell: python

- name: Get pip cache dir
id: pip-cache
Expand Down

0 comments on commit b9e69d5

Please sign in to comment.