Skip to content

Post-release: drop Python 3.9 support and migrate CI to Python 3.10+ - #1081

Merged
kbattocchi merged 1 commit into
mainfrom
kebatt/python-ci-migration
Nov 19, 2026
Merged

kbattocchi merged 1 commit into
mainfrom
kebatt/python-ci-migration

Conversation

@kbattocchi

@kbattocchi kbattocchi commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Release ordering

Post-release layer: keep this draft until the bugfix release is published.

Native stack order: main -> #1082 -> this PR. Merge #1082 first to unblock the bugfix release while preserving Python 3.9 support; this upper layer intentionally drops that support afterward. Do not merge the whole stack before the release.

Summary

  • Require Python 3.10+ and remove the Python 3.9 classifier (Python 3.9 has been deprecated for over a year; Python 3.10 was recently deprecated but we may have users who have not yet migrated from it).
  • Remove Python 3.9 from the test and LKG-generation matrices. Restore both jobs to ${{ matrix.os }} and remove the temporary Python 3.9 runner regression test, since its workaround is no longer needed.
  • Remove Python 3.9 from the pinned wheel selector. cibuildwheel automatically reads project.requires-python, excluding Python 3.8 and 3.9 in both LKG and floating builds without additional CIBW_SKIP patterns.
  • Add documented workflow regression checks for package metadata and interpreter coverage. Retain the lower layer's lint/workflow-test configuration check.

Linting on Python 3.12 and the shared workflow-test command are already provided by #1082. This PR adds one migration commit above that lower layer. Dependency lower bounds and existing LKG snapshots are deliberately unchanged. Python 3.10 remains supported to avoid an unnecessary additional compatibility break.

Interaction with #1055

Kept separate from #1055's dependency-profile and per-cell LKG redesign. When rebasing #1055 onto this work:

  • Keep its expanded workflow-helper test command; update the command expectation in test_ci_runners.py accordingly.
  • Keep its removal of store-reqs-per-env.
  • Preserve the Python 3.12 lint interpreter, Python 3.10+ test matrix, and updated pinned wheel selector alongside its build-constraint settings. The existing CIBW_SKIP stays unchanged; Requires-Python handles interpreter exclusions.

This layer's checks live in a separate test_python_support.py file to avoid overlapping its existing workflow tests.

@kbattocchi
kbattocchi force-pushed the kebatt/python-ci-migration branch from d3b382b to 4eaa7f4 Compare November 12, 2026 20:17
@kbattocchi
kbattocchi requested review from fverac and a balanced review from Copilot November 12, 2026 20:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues
What changed in this PR

Drops Python 3.9 support across package metadata and CI, aligning workflow interpreter selections with Requires-Python and adding regression checks to prevent future drift.

Changes:

  • Update requires-python to >=3.10 and remove the Python 3.9 classifier.
  • Update CI lint/test matrices and wheel build selector to exclude Python 3.9 and run linting on Python 3.12.
  • Add workflow regression tests to enforce consistency between metadata and CI interpreter versions.
File Description
pyproject.toml Bumps minimum supported Python to 3.10 and removes the 3.9 trove classifier.
.github/​workflows/​ci.yml Updates lint/test Python versions and runs new workflow regression tests in CI.
.github/​workflows/​publish-package.yml Removes CPython 3.9 from the pinned (LKG) cibuildwheel build selector.
.github/​workflows/​tests/​test_python_support.py Adds tests to keep Requires-Python, classifiers, and CI matrices in sync.

Review effort: Lite

Comment thread .github/workflows/ci.yml Resolved
@kbattocchi
kbattocchi force-pushed the kebatt/python-ci-migration branch from 4eaa7f4 to 29eff85 Compare November 12, 2026 21:26
@kbattocchi
kbattocchi changed the base branch from main to kebatt/temporary-python39-ci November 12, 2026 21:26
@kbattocchi
kbattocchi added this pull request to stack #1083 November 12, 2026 21:27
@kbattocchi kbattocchi changed the title Drop Python 3.9 support and migrate CI to Python 3.10+ Post-release: drop Python 3.9 support and migrate CI to Python 3.10+ Nov 12, 2026
@fverac

fverac commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Will this test from branch kebatt/temporary-python39-ci

def test_python39_linux_runner_only(job_name, os, python_version):
    """Pin only Python 3.9 Linux jobs to Ubuntu 24.04, preserving all other matrix runners.

    Parse the workflow's restricted equality/AND/OR selector and evaluate its captured
    operands for both matrix jobs, including versions used by notebook LKG entries.
    This remains valid when Python 3.9 is removed from the matrices after the release.
    """
    selector = CI["jobs"][job_name]["runs-on"]
    match = re.fullmatch(
        r"\$\{\{ matrix\.os == '([^']+)' && matrix\.python-version == '([^']+)' "
        r"&& '([^']+)' \|\| matrix\.os \}\}",
        selector,
    )
    assert match is not None, f"Unexpected runner selector: {selector}"
    selected_os, selected_version, pinned_runner = match.groups()
    runner = pinned_runner if os == selected_os and python_version == selected_version else os
    expected = "ubuntu-24.04" if os == "ubuntu-latest" and python_version == "3.9" else os
    assert runner == expected

still be necessary once we fully drop python 3.9?

@kbattocchi
kbattocchi force-pushed the kebatt/python-ci-migration branch 3 times, most recently from e80fbfb to 2a29bc5 Compare November 13, 2026 22:11
@kbattocchi

Copy link
Copy Markdown
Member Author

Will this test from branch kebatt/temporary-python39-ci

def test_python39_linux_runner_only(job_name, os, python_version):
    """Pin only Python 3.9 Linux jobs to Ubuntu 24.04, preserving all other matrix runners.

    Parse the workflow's restricted equality/AND/OR selector and evaluate its captured
    operands for both matrix jobs, including versions used by notebook LKG entries.
    This remains valid when Python 3.9 is removed from the matrices after the release.
    """
    selector = CI["jobs"][job_name]["runs-on"]
    match = re.fullmatch(
        r"\$\{\{ matrix\.os == '([^']+)' && matrix\.python-version == '([^']+)' "
        r"&& '([^']+)' \|\| matrix\.os \}\}",
        selector,
    )
    assert match is not None, f"Unexpected runner selector: {selector}"
    selected_os, selected_version, pinned_runner = match.groups()
    runner = pinned_runner if os == selected_os and python_version == selected_version else os
    expected = "ubuntu-24.04" if os == "ubuntu-latest" and python_version == "3.9" else os
    assert runner == expected

still be necessary once we fully drop python 3.9?

@fverac - good catch, removed that from this follow-up PR.

Base automatically changed from kebatt/temporary-python39-ci to main November 14, 2026 01:34
@kbattocchi
kbattocchi force-pushed the kebatt/python-ci-migration branch from 2a29bc5 to dd1c636 Compare November 14, 2026 01:34
@kbattocchi
kbattocchi marked this pull request as ready for review November 19, 2026 19:13
Require Python 3.10+, run linting on 3.12, and remove Python 3.9 from the test and LKG-generation matrices and pinned wheel selector. cibuildwheel reads requires-python to filter unsupported interpreters in both pinned and floating builds.

Keep dependency floors and LKG snapshots unchanged to limit overlap with #1055. Add documented workflow regression checks.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Keith Battocchi <[email protected]>
@kbattocchi
kbattocchi force-pushed the kebatt/python-ci-migration branch from dd1c636 to c34588c Compare November 19, 2026 19:13
@kbattocchi
kbattocchi enabled stacked auto-merge (rebase) November 19, 2026 20:15
@kbattocchi
kbattocchi merged commit 5631151 into main Nov 19, 2026
95 checks passed
@kbattocchi
kbattocchi deleted the kebatt/python-ci-migration branch November 19, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants