Drop Python 3.9 support and update type hints#906
Merged
Conversation
4167451 to
05ed30d
Compare
Removed Python 3.9 support from workflows, documentation, and pyproject.toml. Updated type hints throughout the codebase to use PEP 604 union syntax (e.g., str | None) and cleaned up related imports. Minor formatting improvements and dependency updates for Python 3.10+ compatibility.
05ed30d to
8ca2cb1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR drops Python 3.9 support and modernizes the codebase for Python 3.10+ compatibility. It updates type hints to use PEP 604 union syntax (X | Y instead of Optional[X]/Union[X, Y]), bumps CI and documentation references, and regenerates poetry.lock to remove Python 3.9-specific dependency entries.
Changes:
- Replaced all
Optional[X]andUnion[X, Y]type hints with PEP 604 syntax (X | None,X | Y) across all datatype, model, and login modules, removing now-unusedtypingimports. - Updated CI workflows,
pyproject.toml, README, and copilot instructions to reflect the new Python version range (3.10–3.14 stable, 3.15-dev). - Regenerated
poetry.lockto remove duplicate Python 3.9-era package entries and version markers.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Removed Python 3.9 classifier, added 3.15, bumped minimum to ^3.10 |
poetry.lock |
Removed Python 3.9 package variants and markers |
README.md |
Updated supported version text from 3.9–3.13 to 3.10–3.14 |
.github/workflows/python-pytest.yaml |
Updated test matrix: dropped 3.9, added 3.14 stable and 3.15-dev |
.github/workflows/python-lint.yaml |
Bumped lint Python from 3.13 to 3.14 |
.github/workflows/publish-to-pypi.yaml |
Bumped publish Python from 3.13 to 3.14 |
.github/copilot-instructions.md |
Updated version references to 3.10+/3.15-dev |
wikibaseintegrator/wbi_config.py |
Replaced Union with | syntax, removed typing import |
wikibaseintegrator/wbi_login.py |
Replaced Optional with | None syntax |
wikibaseintegrator/wbi_enums.py |
Added blank line formatting fix |
wikibaseintegrator/wbi_backoff.py |
Added blank line formatting fixes |
wikibaseintegrator/models/claims.py |
Moved Callable import from typing to collections.abc |
wikibaseintegrator/datatypes/*.py (13 files) |
Replaced Optional/Union with PEP 604 syntax in all datatype modules |
You can also share your feedback on Copilot code review. Take the survey.
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.
Removed Python 3.9 support from workflows, documentation, and pyproject.toml. Updated type hints throughout the codebase to use PEP 604 union syntax (e.g., str | None) and cleaned up related imports. Minor formatting improvements and dependency updates for Python 3.10+ compatibility.