Repository navigation
enable Python 3.10 support - #6
Merged
Merged
Conversation
Bernhard's patch (33a86b3) adds Python 3.10 support via a `tomllib`→`tomli` shim, but did not extend the CI matrix to actually test on 3.10. Without a matrix cell, the package would claim support we don't verify. Adds three new matrix cells so every supported Python gets a status check on every PR: - `Tests (py3.10, all)` — tomli shim path - `Tests (py3.11, all)` — stdlib tomllib, first supported version - (3.12 and 3.13 cells already existed) Verified locally: 133 passed / 11 skipped on 3.10 (parity with 3.12). 11 skipped are pymatgen-gated tests that skip on pymatgen's own Python constraints, not a 3.10 issue. Also refreshes uv.lock for the relaxed `requires-python = ">=3.10"`. Some pandas/scipy/pymatgen/pint entries now carry multiple versions in the universal resolution because they have different Python- version compatibility windows — standard uv behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
gerchowl
added a commit
that referenced
this pull request
Apr 15, 2026
- pyproject.toml: version 2.0.5 → 2.1.0 - src/pymat/__init__.py: __version__ synced to 2.1.0 (was stuck at 2.0.4 after the 2.0.5 release — pre-existing drift) - CHANGELOG.md: new [2.1.0] section covering everything since v2.0.5: Material.molar_mass + pymat.elements (new API), Python 3.10 support (#6), enricher docstring rewrite, ADR infrastructure, infrastructure work (rulesets, matrix CI, Rust gate, .typos.toml safety net, sync-main-to-dev merge-tree fix, template refresh, dependabot security bumps). Semver: MINOR bump justified by new public API surface (Material.molar_mass, Material.molar_mass_qty, pymat.elements module) and expanded Python version support (3.10 added). No breaking changes. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
gerchowl
added a commit
to gerchowl/build123d
that referenced
this pull request
Apr 15, 2026
py-materials 2.1.0 shipped earlier today with Python 3.10 support via @bernhard-42's own tomli shim (MorePET/mat#6). The two temporary commits that dropped 3.10 from this PR (bbb193c "temporarily remove Python 3.10 for compatibility with py-materials" and 6c0699d "use Python 3.11 instead of 3.10 for CI/CD") are no longer needed. - pyproject.toml: - `requires-python = ">= 3.11, < 3.15"` → `">= 3.10, < 3.15"` - `py-materials >= 2.0.5, < 2.1.0` → `py-materials >= 2.1.0, < 3.0.0` - .readthedocs.yaml: `python: "3.11"` → `"3.10"` - .github/workflows/{coverage,lint,test,type}.yml: 3.11 → 3.10 Verified on Python 3.10 locally: - `uv run --python 3.10 --isolated --extra development --extra ocp_vscode` installs cleanly with py-materials 2.1.0 - `import build123d` works; 1871 tests collect without error - `pytest -k "material or mass"` → 32 passed, 2 skipped (pre-existing) - End-to-end smoke test: `box.material = "brass"` (string catalog lookup via py-materials) + `box.mass` returns a real number, not a 1.0-fallback warning - Closes the "open blocker" listed in gumyr#1270's description Refs MorePET/mat#6 (Python 3.10 support in py-materials) Refs MorePET/mat#3 (overall collaboration thread) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
gerchowl
added a commit
that referenced
this pull request
May 5, 2026
…183) Per ADR-0003, `_stddev` is loader sugar — not a parallel set of dataclass fields. The existing in-value `{nominal, stddev}` form remains canonical (now also routed through `_parse_value` for property scalars, not just compositions). Sibling sugar exists for hand-edited TOML ergonomics. Loader (src/pymat/loader.py): - Two-pass `update_properties`: collect `<base>_stddev` siblings, then route each value through `_parse_value` and fold sibling stddev into a ufloat at assignment time. - Hard error on double-specification (in-value `{nominal, stddev}` AND sibling `_stddev`) — silent precedence is worse than failure. - Hard error on orphan stddev (`density_stddev` with no base value). Boundary helpers (per ADR-0003 #6): - `Material.density_g_mm3` coerces ufloat → nominal float for build123d (which can't accept ufloats in mass calculations). - pymat-mcp `_nominal()` helper applied at JSON boundaries (`_props_dict`, `_brief`, `compute_mass`) so agents never see a ufloat that `json.dumps` can't serialize. Tests: - `tests/test_stddev_sugar.py` (11 tests): sibling sugar + value form + double-spec + orphan + zero stddev + multiple fields per group + density_g_mm3 boundary + mass_from_volume_mm3 boundary. - `clients/python/pymat-mcp/tests/test_tools.py::TestComputeMass:: test_ufloat_density_returns_plain_floats`: end-to-end JSON round-trip with a ufloat density. Full suite: 499 passed, 11 skipped, no regressions. Closes #149
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.
Description
Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
We would like to use py-materials as the materials provider for build123d, see #3
build123d supports Python 3.10 - 3.14
We were wondering whether py-materials could also support Python 3.10
As far as I can see, the only issue is the use of
tomllib, however there is a proven workaround withtomliin Python 3.10.This PR adds tomli conditionally as 3.10 dependency and has a Python version checked import of tomli or tomllib
CC: @gumyr
Changelog Entry
Testing
I just ran the pytest suite under Python 3.10 and it created the same result as under Python 3.14
Manual Testing Details
Run the pytest suite under Python 3.10
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
None
Refs:
(#3)