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

Changes for Python 3.13 support #569

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

monocongo
Copy link
Owner

@monocongo monocongo commented Dec 9, 2024

Updates to allow for Python 3.13. Since we need the latest version of scipy which itself requires Python 3.10 we will have to drop support for 3.8 and 3.9 if this is merged.

Summary by Sourcery

Add support for Python 3.13 by updating dependencies and configuration, including scipy to version 1.14.1. Drop support for Python 3.8 and 3.9, and update CI to test against newer Python versions.

New Features:

  • Add support for Python 3.13 by updating dependencies and configuration.

Enhancements:

  • Update scipy dependency to version 1.14.1 to ensure compatibility with Python 3.13.
  • Remove workaround for scipy bug related to Pearson3 distribution as it is no longer needed.

Build:

  • Update Python version compatibility in pyproject.toml to support Python 3.10 to 3.13 and drop support for 3.8 and 3.9.

CI:

  • Update CI configuration to test against Python versions 3.10, 3.11, 3.12, and 3.13.

Copy link

sourcery-ai bot commented Dec 9, 2024

Reviewer's Guide by Sourcery

This PR updates the project's Python version support to accommodate Python 3.13 while dropping support for Python 3.8 and 3.9. The change is implemented through updates to dependency specifications, GitHub workflow configurations, and code adjustments. The PR also includes preparation for a potential future migration from Poetry to uv package manager.

Class diagram for updated dependencies in pyproject.toml

classDiagram
    class Project {
        - version: String
        - python: String
        - scipy: String
        - cftime: String
        - dask: String
        - h5netcdf: String
        - xarray: String
        - coverage: String
        - pytest: String
        - toml: String
    }
    note for Project "Updated Python version to >=3.10,<3.14 and scipy to >=1.14.1. Dropped support for Python 3.8 and 3.9."
Loading

File-Level Changes

Change Details Files
Updated Python version support and dependencies
  • Changed Python version requirement from '>=3.8,<3.12' to '>=3.10,<3.14'
  • Upgraded scipy requirement to '>=1.14.1'
  • Updated other dependencies to their latest versions (dask, h5netcdf, xarray)
  • Added coverage as a dev dependency
  • Bumped version from 2.0.1 to 2.0.2
pyproject.toml
Modified Python classifiers and project metadata
  • Removed Python 3.8 and 3.9 classifiers
  • Added Python 3.12 and 3.13 classifiers
  • Updated Scientific/Engineering topic from 'Atmospheric Science' and 'Physics' to 'Climate Science'
pyproject.toml
Updated CI workflow configuration
  • Modified Python version matrix to test against 3.10, 3.11, 3.12, and 3.13
  • Removed testing for Python 3.8 and 3.9
.github/workflows/unit-tests-workflow.yml
Removed legacy scipy version workaround
  • Disabled Pearson3 workaround by setting _do_pearson3_workaround to False
  • Commented out version comparison code
src/climate_indices/compute.py
Added configuration for future uv package manager migration
  • Added commented-out pyproject.toml configuration for uv
  • Included equivalent dependency specifications for uv format
  • Added build configuration for PDM
pyproject.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @monocongo - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider removing the obsolete pearson3_workaround code entirely since it's now permanently set to False and the minimum scipy version (1.14.1) is well above where this workaround was needed (1.6.0).
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

sonarqubecloud bot commented Dec 9, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant