Skip to content

Conversation

@tomvothecoder
Copy link
Collaborator

@tomvothecoder tomvothecoder commented Jan 6, 2026

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

  • 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

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

If applicable:

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass with my changes (locally and CI/CD build)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)

- 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
@tomvothecoder tomvothecoder requested a review from Copilot January 6, 2026 18:32
@tomvothecoder tomvothecoder self-assigned this Jan 6, 2026
@tomvothecoder tomvothecoder added the type: devops Testing, CI/CD, systems configuration label Jan 6, 2026
@tomvothecoder tomvothecoder moved this from Todo to Done in xCDAT Development Jan 6, 2026
@tomvothecoder tomvothecoder moved this from Done to In Review in xCDAT Development Jan 6, 2026
@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (affce83) to head (b8d0734).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a 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]>
@tomvothecoder tomvothecoder merged commit 602e9ae into main Jan 6, 2026
10 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in xCDAT Development Jan 6, 2026
@tomvothecoder tomvothecoder deleted the devops/808-py14-support branch January 6, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: devops Testing, CI/CD, systems configuration

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Add support for Python 3.14 in local repo

2 participants