Support Python 3.10 and fix typeguard coverage of JAX trace paths#22
Merged
Conversation
….2.2) Lower the minimum supported Python version from 3.11 to 3.10 (requires-python = ">=3.10, <3.15") and add 3.10 to the CI test matrices. The code base uses no 3.11-only features, so this only broadens compatibility for downstream packages that still support Python 3.10. On 3.10 the resolver selects compatible older wheels (e.g. numpy 2.2.x, jaxlib 0.6.x); the full test suite passes on 3.10 with and without the JAX extra. Also fix runtime type checking of the JAX trace paths: - Annotate the fold-index parameters (validation_indices/val_indices) with a new IndexArray alias that _enable_jax_typing() broadens to admit jax.Array, matching the Array/Scalar aliases from 3.2.1. They were previously annotated npt.NDArray[np.int_] only, so the jax.jit/jax.vmap trace tests failed under typeguard (the indices are abstract tracers under tracing). Runtime behavior is unchanged. - Enable typeguard for real in CI: the test command passed --typeguard-packages=cvmatrix/ (a path with a trailing slash), which silently instruments nothing and masked the annotation issue. It now passes the package name, cvmatrix.
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.
Lower the minimum supported Python version from 3.11 to 3.10 (requires-python = ">=3.10, <3.15") and add 3.10 to the CI test matrices. The code base uses no 3.11-only features, so this only broadens compatibility for downstream packages that still support Python 3.10. On 3.10 the resolver selects compatible older wheels (e.g. numpy 2.2.x, jaxlib 0.6.x); the full test suite passes on 3.10 with and without the JAX extra.
Also fix runtime type checking of the JAX trace paths:
Annotate the fold-index parameters (validation_indices/val_indices) with a new IndexArray alias that enable_jax_typing() broadens to admit jax.Array, matching the Array/Scalar aliases from 3.2.1. They were previously annotated npt.NDArray[np.int] only, so the jax.jit/jax.vmap trace tests failed under typeguard (the indices are abstract tracers under tracing). Runtime behavior is unchanged.
Enable typeguard for real in CI: the test command passed --typeguard-packages=cvmatrix/ (a path with a trailing slash), which silently instruments nothing and masked the annotation issue. It now passes the package name, cvmatrix.