Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce test wheel matrix #687

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,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]
# TODO: also test windows
os: [ubuntu-20.04, macos-13]
# some versions of python can't be tested on GHA with osx because of SIP:
Expand Down
25 changes: 21 additions & 4 deletions ci/update_python_test_versions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from collections import defaultdict
import requests
import pathlib
import re
Expand All @@ -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

Expand All @@ -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


Expand Down Expand Up @@ -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)
Expand Down
Loading