GEOPY-2661: modernize code for Python >= 3.12#844
Merged
Conversation
and point to newer numpy version in pre-commit config (although it is still commented-out)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #844 +/- ##
===========================================
+ Coverage 91.14% 91.18% +0.04%
===========================================
Files 115 115
Lines 10275 10272 -3
Branches 1898 1898
===========================================
+ Hits 9365 9367 +2
+ Misses 487 483 -4
+ Partials 423 422 -1
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates project tooling configuration to align with Python 3.12 and modernizes internal typing utilities to use Python 3.12 generic syntax.
Changes:
- Bump Ruff target version from Python 3.10 to 3.12 in
pyproject.toml. - Update Pylint’s
py-versionto 3.12. - Refactor
weakref_utilstyping to use PEP 695 type parameters (Python 3.12+).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
pyproject.toml |
Align Ruff target version with Python 3.12. |
pylintrc |
Update Pylint’s minimum Python version checks to 3.12. |
geoh5py/shared/weakref_utils.py |
Switch from TypeVar to PEP 695 type parameters for weakref helpers. |
.pre-commit-config.yaml |
Adjust commented mypy extra dependency hint for numpy. |
Comments suppressed due to low confidence (1)
geoh5py/shared/weakref_utils.py:63
- The docstring for
insert_oncedocuments a return value (":return: Dictionary with clean weakref"), but the function mutatessome_dictin place and returnsNone. Please adjust the docstring (and/or add an explicit-> None) so callers don’t assume there is a return value.
def insert_once[K](some_dict: dict[K, ReferenceType], key: K, value):
"""
Check if the reference to an Entity with uuid is already in use.
:param some_dict: Dictionary of UUID keys and weakref values.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
domfournier
previously approved these changes
Feb 19, 2026
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.
GEOPY-2661 - Update minimum requirement to python >=3.12, <3.15 and numpy 2.*