ci: matrix Python 3.12+all-extras and 3.13+core (closes #11)#15
Merged
ci: matrix Python 3.12+all-extras and 3.13+core (closes #11)#15
Conversation
Fixes #11. The root cause of the 3.12 pin was that CI ran `uv sync --all-extras` on a single Python, so the narrowest optional-extra's Python support (`vtk` and `cadquery-ocp`, both cp311/cp312-only, pulled in via `build123d`) became the project's effective Python support. `py-materials`'s only hard dependency is `pint`; the build123d integration is optional, and the core library works on 3.13+. Changes: - **pyproject.toml**: environment markers on `build123d`, `dev`, and `all` extras — `build123d>=0.7.0; python_version<'3.13'`. Installers silently drop the dep on 3.13+ instead of erroring on a missing wheel. Also add `Python :: 3.13` classifier. - **uv.lock**: regenerated to reflect the markers. - **ci.yml**: new `test-matrix` job with two cells: - `py3.12, all` — full integration including build123d - `py3.13, core` — `--extra periodictable --extra matproj`, skips build123d-dependent tests A `test` roll-up job with `needs: [test-matrix]` keeps the `Tests` context name stable, so branch rulesets don't need updating. Matrix cells appear under `Tests (py3.12, all)` / `Tests (py3.13, core)`. - **setup-env/action.yml**: new `python-version` input (overrides `.python-version` when set) and `uv-sync-args` input (lets matrix cells pass `--extra ...` instead of the fixed `--all-extras`). - **.python-version**: left at `3.12` for local dev convenience (covers all-extras out of the box). Users who want 3.13 for core work can override via `UV_PYTHON`. Verified locally: 133 pass / 11 skip on 3.12 all-extras; 107 pass / 26 skip on 3.13 core (the 26 skips are build123d-gated tests, which correctly skip when the dep is absent). A build123d regression stays loud because the 3.12 cell still runs the full integration suite — the original concern about "break build123d and not notice immediately" is preserved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
On 3.13, --all-extras correctly skips build123d (via env marker) and still installs pytest, periodictable, matproj. No need to enumerate --extra ... explicitly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #11. Decouples Python version from the narrowest optional extra.
py-materials's only hard dep ispint;build123dis optional and pullscadquery-ocp+vtk, both of which have wheels only for cp311/cp312 as of 2026-04. Previously CI ranuv sync --all-extrason a single Python, so that narrow window became the whole project's effective Python support —.python-versionpinned to 3.12 everywhere.What changed
Environment markers on
pyproject.tomlextras.build123d = ["build123d>=0.7.0; python_version<'3.13'"](and same ondev,all). On 3.13+, installers silently drop the dep instead of erroring with an unresolved wheel.requires-python = ">=3.11"is now honest for the core.Matrix CI with a roll-up gate.
ci.yml'stestjob is split intotest-matrix(two cells) + a thintestroll-up that preserves theTestsstatus-check context:py3.12, all--all-extras(full build123d integration)py3.13, core--extra periodictable --extra matprojThe roll-up pattern means existing branch rulesets (which require
Tests) don't need to change — thetestjob still reports asTests, just now depending on the matrix. Individual cells appear alongside asTests (py3.12, all)andTests (py3.13, core)for visibility.setup-env/action.ymlgains two inputs:python-version(overrides.python-versionwhen set — matrix cells pass this in)uv-sync-args(default--all-extras, matrix cells override)Why this keeps build123d regressions visible
The user's concern on #11 was: "if we don't run build123d tests, we won't notice when we break the integration." Addressed: the
py3.12, allcell runs the full integration suite on every PR. A build123d regression fails that cell immediately, and the roll-upTestsfails with it. No change to ruleset enforcement, no change to visibility.What didn't change
Testsname is preserved by the roll-up, so no admin edit needed..python-versionstays at3.12— it's the local-dev default where--all-extrasjust works.Verified locally
py3.12, all: 133 passed, 11 skippedpy3.13, core: 107 passed, 26 skipped (the 26 are build123d-gated tests, correctly skipped when the dep is absent)Test plan
Tests (py3.12, all),Tests (py3.13, core)Testscheck reports as successRust (mat-rs),Lint & Format,Security Scan,Dependency Review,CodeQL Analysis (python)all green🤖 Generated with Claude Code