Skip to content

Release gemd 3.0.0; drop Python 3.9 support - #239

Draft
kroenlein wants to merge 8 commits into
mainfrom
release/3.0
Draft

kroenlein wants to merge 8 commits into
mainfrom
release/3.0

Conversation

@kroenlein

Copy link
Copy Markdown
Collaborator

GEMD Python PR

Description

This PR releases gemd 3.0.0, which drops support for Python 3.9. The release requires Python 3.10 or later. CI tests Python 3.10 through 3.14.

Each commit covers one topic, so you can review it commit by commit. The pyupgrade commit is mechanical and touches 50 files.

Breaking changes

Change Effect on callers
requires-python is >=3.10 pip installs gemd 2.x on Python 3.9.
This PR deletes the "clean" unit format f"{unit:clean}" raises an error. Version 2.1.0 deprecated the format and scheduled its removal for 3.0.0.
This PR deletes gemd.util._cached_isinstance Call cached_isinstance instead. citrine-python does not use the private alias.
CaseInsensitiveDict.get and .pop accept only positional arguments d.get(key="x") raises TypeError, as it does for dict.

Code changes

  • (bytes, bytearray) replaces typing.ByteString. Python 3.14 removes ByteString, and the pair matches the same types.
  • The code uses 3.10 syntax: X | Y unions, builtin generics, and collections.abc imports.
  • CaseInsensitiveDict is generic over its value type. Its methods return the types that dict returns.
  • The tests read and write files with pathlib. A new StringIO round trip in test_json.py covers gemd.json.dump and load.
  • The API docs skip members inherited from builtins, such as int.to_bytes on WarningLevel. With that change, the docs build passes with warnings as errors.

Environment and CI

  • This PR commits uv.lock. It deletes requirements.txt, test_requirements.txt, doc_requirements.txt, tox.ini, and scripts/, because pyproject.toml and the v3 checks replace them.
  • PR tests and PR checks use common-gh-actions v3. The checks lint with ruff instead of flake8 and verify uv.lock. They check the version bump on PRs into main and skip it elsewhere.
  • deploy-docs.yml runs its build steps in this repo with uv run. The shared v3 workflow runs make without sphinx-build on PATH. A fix is under review in common-gh-actions. After it merges, point this workflow back at the shared one and add check_docs: true to pr-checks.yml.
  • On Python 3.14, the dev dependencies require numpy 2.3.2 and pandas 2.3.3, the first releases with 3.14 wheels. CI tests the lowest allowed versions, and older releases would build from source.

Testing

  • 233 tests pass with 100% coverage on Python 3.10 and 3.14, with both the lowest and the highest dependency versions.
  • ruff, uv lock --check, and the deprecation check pass.
  • The docs build passes with -W --keep-going.

Follow-up

A ty type check reports 374 diagnostics in gemd/. Adopting it is separate work.

PR Type:

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Maintenance (non-breaking change to assist developers)

Adherence to team decisions

  • I have added tests for 100% coverage
  • I have written Numpy-style docstrings for every method and class.
  • I have communicated the downstream consequences of the PR to others.
  • I have bumped the version in __version__.py

🤖 Generated with Claude Code

kroenlein and others added 7 commits October 14, 2026 13:50
- Require Python 3.10 and remove the 3.9 classifier and dependency pins
- Remove the typing_extensions fallback for TypeAlias
- Remove the deprecated "clean" unit format, scheduled for removal in 3.0.0
- Replace typing.ByteString, removed in Python 3.14, with (bytes, bytearray)
- Remove the private _cached_isinstance alias
- Move PR tests to the common-gh-actions v3 matrix, which skips 3.9 and adds 3.14
- Raise numpy and pandas lower bounds on 3.14 to the first releases with wheels

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apply ruff's pyupgrade fixes for a 3.10 target: PEP 604 unions, builtin
generics, and collections.abc imports. Convert module-level type aliases
by hand and unquote two test annotations whose names are imported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Make CaseInsensitiveDict generic over its value type and add overloads to
get and pop so each override returns the type dict declares. The key and
default arguments of get and pop are now positional-only, as in dict.

Ignore flake8 E704 because ruff format keeps overload stubs on one line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read and write test files with Path.read_text and Path.write_text, and
replace the legacy tmpdir fixture with tmp_path. Replace the demo test
that wrote a temp file with a StringIO round trip in test_json, which
covers gemd.json.dump and load directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Commit uv.lock and delete requirements.txt, test_requirements.txt,
  and doc_requirements.txt, which duplicated pyproject.toml
- Move PR checks to repo-checks v3, which lints with ruff, verifies
  uv.lock, and checks the version bump only for PRs into main
- Delete tox.ini and the flake8, flake8-docstrings, and derp dev
  dependencies, which the v3 checks replace
- Delete scripts/run_tests.sh and scripts/validate_version_bump.py
- Build docs for deployment with uv run, which puts sphinx-build on
  PATH; deploy-docs v3 runs make outside the uv environment
- Update CONTRIBUTING.md for the uv workflow

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The docs document every module with inherited-members, so autodoc
rendered int and dict methods on classes such as WarningLevel and
CaseInsensitiveDict. Two of those builtin docstrings raise Sphinx
warnings. Skip members implemented in C so the docs build cleanly
with warnings as errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bring in get_compatible_units from #238. Keep version 3.0.0 over 2.4.0,
convert the new function's annotations to 3.10 syntax, and apply ruff
format to the new test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kroenlein kroenlein changed the title Release gemd 3.0.0: drop Python 3.9 Release gemd 3.0.0; drop Python 3.9 support Oct 16, 2026
numpy 2.0.2 publishes no Python 3.13 wheels. CI tests the lowest allowed
versions, so the 3.13 lanes built numpy from source, and the build fails
on the macOS runner. numpy 2.1.0 is the first release with 3.13 wheels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant