diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8be7bd72..08f8d81c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -170,7 +170,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.6.7, 3.6.8, 3.6.9, 3.6.10, 3.6.11, 3.6.12, 3.6.13, 3.6.14, 3.6.15, 3.7.1, 3.7.2, 3.7.3, 3.7.4, 3.7.5, 3.7.6, 3.7.7, 3.7.8, 3.7.9, 3.7.10, 3.7.11, 3.7.12, 3.7.13, 3.7.14, 3.7.15, 3.7.16, 3.7.17, 3.8.0, 3.8.1, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.8.10, 3.8.11, 3.8.12, 3.8.13, 3.8.14, 3.8.15, 3.8.16, 3.8.17, 3.8.18, 3.9.0, 3.9.1, 3.9.2, 3.9.3, 3.9.4, 3.9.5, 3.9.6, 3.9.7, 3.9.8, 3.9.9, 3.9.10, 3.9.11, 3.9.12, 3.9.13, 3.9.14, 3.9.15, 3.9.16, 3.9.17, 3.9.18, 3.9.19, 3.9.20, 3.10.0, 3.10.1, 3.10.2, 3.10.3, 3.10.4, 3.10.5, 3.10.6, 3.10.7, 3.10.8, 3.10.9, 3.10.10, 3.10.11, 3.10.12, 3.10.13, 3.10.14, 3.10.15, 3.11.0, 3.11.1, 3.11.2, 3.11.3, 3.11.4, 3.11.5, 3.11.6, 3.11.7, 3.11.8, 3.11.9, 3.11.10] + python-version: [3.6.7, 3.6.15, 3.7.1, 3.7.17, 3.8.0, 3.8.18, 3.9.0, 3.9.20, 3.10.0, 3.10.1, 3.10.2, 3.10.3, 3.10.4, 3.10.5, 3.10.6, 3.10.7, 3.10.8, 3.10.9, 3.10.10, 3.10.11, 3.10.12, 3.10.13, 3.10.14, 3.10.15, 3.11.0, 3.11.1, 3.11.2, 3.11.3, 3.11.4, 3.11.5, 3.11.6, 3.11.7, 3.11.8, 3.11.9, 3.11.10] os: [ubuntu-20.04, macos-13, windows-latest] # some versions of python can't be tested on GHA with osx because of SIP: exclude: diff --git a/ci/update_python_test_versions.py b/ci/update_python_test_versions.py index 58f50a58..6a53286d 100644 --- a/ci/update_python_test_versions.py +++ b/ci/update_python_test_versions.py @@ -1,3 +1,4 @@ +from collections import defaultdict import requests import pathlib import re @@ -13,8 +14,10 @@ def parse_version(v): def get_github_python_versions(): versions_json = requests.get(_VERSIONS_URL).json() raw_versions = [v["version"] for v in versions_json] - versions = [] - for version_str in raw_versions: + + minor_versions = defaultdict(list) + + for version_str in raw_versions: if "-" in version_str: continue @@ -26,8 +29,22 @@ def get_github_python_versions(): elif major == 2 and minor < 7: # we don't test python support before 2.7 continue + minor_versions[(major, minor)].append(patch) + + versions = [] + for (major, minor), patches in minor_versions.items(): + patches.sort() + + # for older versions of python, don't test all patches + # (just test first and last) to keep the test matrix down + if (major == 2 or minor < 10): + patches = [patches[0], patches[-1]] + + if (major == 3 and minor >= 12): + continue + + versions.extend(f"{major}.{minor}.{patch}" for patch in patches) - versions.append(version_str) return versions @@ -55,7 +72,7 @@ def get_github_python_versions(): exclusions = [] for v in versions: if v.startswith("3.11"): - exclusions.append(" - os: macos-latest\n") + exclusions.append(" - os: macos-13\n") exclusions.append(f" python-version: {v}\n") test_wheels = transformed.index(" test-wheels:\n") first_line = transformed.index(" exclude:\n", test_wheels)