Fix Python 3.8/3.9 compatibility: replace PEP 604 type hints#116
Draft
Fix Python 3.8/3.9 compatibility: replace PEP 604 type hints#116
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
…CI actions Co-authored-by: edithatogo <15080672+edithatogo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add compatibility fixes for Python 3.8 and 3.9 CI tests
Fix Python 3.8/3.9 compatibility: replace PEP 604 type hints
Nov 9, 2025
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 of Changes
Fixes Python 3.8 and 3.9 compatibility by replacing PEP 604 type hint syntax (introduced in Python 3.10) with
typingmodule equivalents.Type hint changes:
list[T]→List[T]tuple[T, ...]→Tuple[T, ...]X | Y→Union[X, Y]orOptional[Y]Files modified:
pymars/_forward.pypymars/_pruning.pypymars/_record.pypymars/earth.pyCI workflow updates:
actions/checkout@v4andactions/setup-python@v4for stabilityType of Change
Testing
All 107 tests pass locally on Python 3.12. CI will verify Python 3.8, 3.9, 3.10, 3.11, and 3.12.
Checklist
Related Issues
Relates to #114
Additional Context
No
importlib.metadatacompatibility shim needed—not used in codebase. No dict union operator (|) in runtime code.Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.