Skip to content
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

Add support for Python3.13 #398

Merged
merged 16 commits into from
Feb 28, 2025
Merged

Add support for Python3.13 #398

merged 16 commits into from
Feb 28, 2025

Conversation

Zeitsperre
Copy link
Collaborator

@Zeitsperre Zeitsperre commented Feb 26, 2025

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes issue #xyz
  • Tests for the changes have been added (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • HISTORY.rst has been updated (with summary of main changes)

What kind of change does this PR introduce?:

  • First attempt at supporting Python3.13.
  • Added a few security fixes to the GitHub Workflows and CI configurations.
  • Reorganized the LICENSE to be more machine-parsable.
  • Added coverage for Anaconda-based builds in CI.
  • Adjust the README.rst to use a table of badges and added some relevant badges.
  • READTHEDOCS build now reinstall the build environment Python3.12 with psy-maps (should be addressed in the future; see below).
  • Adjusted all use_cftime calls to decode_times=xr.coders.CFDatetimeCoder(use_cftime=True), as is suggested by xarray.
    • This effectively silences 7800 warnings emitted in the testing suite!
  • Lifted the pins on xarray and numpy (failures with specific types of data need to be fixed upstream).

Does this PR introduce a breaking change?:

Yes:

  • psy-map is no longer installed via the conda environment, but is instead patched into the ReadTheDocs environment when building the docs. Ideally, we should remove the code-blocks using this (are there alternatives available?).
  • CI dependencies are now in a new CI directory in the top-level. This makes it easier for Dependabot to perform updates on these libraries. They are installed via commit hashes for added security.
  • All tests that fail due to cf-time/cf-xarray issues are now marked as xfail.

Other information:

The use_cftime keyword arg has been deprecated as of xarray v2025.01.1 (https://docs.xarray.dev/en/stable/generated/xarray.open_dataset.html).

It looks like the psy-maps library is no longer maintained and the package metadata only lists support for version until Python3.10! There is a need to remove this library if we want to build documentation on newer Python versions.

There's also a need to lift the pin on xarray. I know that we have some outstanding issues related to cf-time/cf-xarray that need to be dealt with for that to happen. Relevant issue/PR:

@coveralls
Copy link

coveralls commented Feb 26, 2025

Pull Request Test Coverage Report for Build 13585994050

Details

  • 1 of 2 (50.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+10.1%) to 86.652%

Changes Missing Coverage Covered Lines Changed/Added Lines %
clisops/project_utils.py 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
clisops/project_utils.py 1 89.86%
Totals Coverage Status
Change from base Build 13525219205: 10.1%
Covered Lines: 3077
Relevant Lines: 3551

💛 - Coveralls

@Zeitsperre
Copy link
Collaborator Author

@cehbrecht I'm going to continue organizing this PR so that we can at least receive automated updates. This should make the management of the library a bit simpler. The next step will be to pull out clisops.core and all the tests for that specific module into strop.

@cehbrecht
Copy link
Collaborator

@Zeitsperre could we also add pytest-xdist to run tests in parallel?

@Zeitsperre
Copy link
Collaborator Author

@cehbrecht Possibly! If the tests are written to handle it, I think it shouldn't be an issue. I'll test it locally.

@Zeitsperre Zeitsperre self-assigned this Feb 27, 2025
@Zeitsperre Zeitsperre added dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code python Pull requests that update Python code labels Feb 27, 2025
@Zeitsperre
Copy link
Collaborator Author

Zeitsperre commented Feb 27, 2025

@cehbrecht This is ready to go. Should I wait for #397 before merging this?

Also, FYI, the finish step isn't reporting because I renamed it in the workflow. I'll adjust things in the repo once things are approved.

added Martin
* The `LICENSE` file has been adjusted to ensure it is more machine-parsable (#398).
* Licensing information has been added to the top-level `__init__.py` file of the package (#398).
* The `README.rst` file has been updated to include a table of relevant badges (#398).
* All calls using `use_cftime=True` have been updated to `decode_times=xr.coders.CFDatetimeCoder(use_cftime=True)` as suggested by `xarray` (#398).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have a link to the xarray docs for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cehbrecht
Copy link
Collaborator

@cehbrecht This is ready to go. Should I wait for #397 before merging this?

Also, FYI, the finish step isn't reporting because I renamed it in the workflow. I'll adjust things in the repo once things are approved.

@Zeitsperre looks good. thanks :) you can merge this before the other PR #397

@Zeitsperre Zeitsperre merged commit 1f2afd1 into master Feb 28, 2025
12 checks passed
@Zeitsperre Zeitsperre deleted the support-py313 branch February 28, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants