-
Notifications
You must be signed in to change notification settings - Fork 16
Add support for Python 3.14 #822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Remove py <3.14 constraint in conda environment yml - Add py 3.14 support in `pyproject.toml` - Add py 3.14 to build matrix - Update pre-commit hooks and versions in dev.yml, including ruff to the latest version to support py 3.14
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #822 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 18
Lines 1969 1973 +4
=========================================
+ Hits 1969 1973 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for Python 3.14 by updating Python version constraints across configuration files and tooling versions. The main technical changes involve improving type safety for mypy by introducing a type assertion helper function and updating type annotations to properly handle xarray's hashable keys.
Key Changes
- Added Python 3.14 to supported versions in configuration files and CI/CD workflows
- Updated development tools (ruff, mypy, pre-commit-hooks) to newer versions
- Introduced
_as_dataarray()helper function to preserve type information when using NumPy ufuncs with xarray DataArrays
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added Python 3.14 classifier to project metadata |
| conda-env/dev.yml | Removed Python version upper bound and updated ruff/mypy versions |
| conda-env/ci.yml | Removed Python version upper bound for CI environment |
| .pre-commit-config.yaml | Updated pre-commit hooks to match conda environment versions |
| .github/workflows/build_workflow.yml | Added Python 3.14 to test matrix |
| xcdat/utils.py | Changed return type from list[str] to list[Hashable] for compare_datasets() and added _as_dataarray() type assertion helper |
| xcdat/spatial.py | Applied _as_dataarray() wrapper to preserve type information after NumPy operations |
| xcdat/mask.py | Applied _as_dataarray() wrapper to preserve type information after np.logical_and() |
| xcdat/dataset.py | Removed unnecessary sorted() call when creating a set |
| tests/test_utils.py | Updated tests to use set comparisons instead of sorted lists and added tests for _as_dataarray() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Description
Closes #808
Related to #813
This PR adds support for Python 3.14 by updating Python version constraints across configuration files and tooling versions. The main technical changes involve improving type safety for mypy by introducing a type assertion helper function and updating type annotations to properly handle xarray's hashable keys.
Key Changes
_as_dataarray()helper function to preserve type information when using NumPy ufuncs with xarray DataArraysChecklist
If applicable: