Added a minimum Python version field, so unsupported Python versions (e.g. for macOS) can be disabled.

This commit is contained in:
Patrick Lehmann
2024-04-23 23:30:26 +02:00
parent 0802f6d02f
commit 461931099a

View File

@@ -140,6 +140,7 @@ jobs:
for disable in disabled:
print(f"::warning title=Disabled Python Job::System '{disable}' temporary disabled.")
# see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
data = {
# Python and PyPy versions supported by "setup-python" action
"python": {
@@ -157,9 +158,9 @@ jobs:
},
# Runner systems (runner images) supported by GitHub Actions
"sys": {
"ubuntu": { "icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)" },
"windows": { "icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)" },
"macos": { "icon": "🍎", "runs-on": "macos-latest", "shell": "bash", "name": "MacOS (x86-64)" },
"ubuntu": { "icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)", "minPy": [3, 7]},
"windows": { "icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)", "minPy": [3, 7]},
"macos": { "icon": "🍎", "runs-on": "macos-latest", "shell": "bash", "name": "MacOS (x86-64)", "minPy": [3, 10]},
},
# Runtimes provided by MSYS2
"runtime": {
@@ -188,6 +189,7 @@ jobs:
if system in data["sys"]
for version in versions
if version in data["python"]
and [int(i) for i in version.split(".")] >= data["sys"][system]["minPy"]
and f"{system}:{version}" not in excludes
and f"{system}:{version}" not in disabled
] + [
@@ -201,6 +203,7 @@ jobs:
for system, version in includes
if system in data["sys"]
and version in data["python"]
and [int(i) for i in version.split(".")] >= data["sys"][system]["minPy"]
and f"{system}:{version}" not in disabled
]
print(f"Combinations ({len(combinations)}):")