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

Bump min python version to 3.10 and update metadata #318

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

AntObi
Copy link
Collaborator

@AntObi AntObi commented Sep 26, 2024

Description

Following suit with pymatgen which in turn follows numpy, scipy and the rest of the NumFOCUS stack, this PR drops Python 3.9 support.

Fixes #316

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

N/A

Reviewers

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Summary by CodeRabbit

  • New Features
    • Version updated to 2.8, enhancing overall functionality.
    • Python version requirement updated to 3.10 or higher for improved compatibility.
  • Bug Fixes
    • Removed upper limit on numpy and pymatgen dependencies to ensure access to the latest features.
  • Chores
    • Updated CI workflow to test against Python versions 3.10, 3.11, and 3.12 only.

Copy link
Contributor

coderabbitai bot commented Sep 26, 2024

Walkthrough

The pull request introduces updates to the CI workflow and the setup.py file. The CI configuration now tests against Python versions 3.10, 3.11, and 3.12, removing version 3.9. In setup.py, the version number is incremented to 2.8, the date is updated, and the upper limits on the numpy and pymatgen dependencies have been removed. Additionally, the Python requirement has been changed to require version 3.10 or higher.

Changes

File Change Summary
.github/workflows/ci.yml Removed Python version 3.9 from the CI workflow matrix, retaining versions 3.10, 3.11, and 3.12.
README.md Updated compatibility statement to reflect testing with Python 3.10+.
setup.py Updated version to 2.8, date to September 26, 2024, removed upper limits on numpy and pymatgen, and changed Python requirement to >=3.10.

Assessment against linked issues

Objective Addressed Explanation
Can the upper pin on pymatgen be removed? (#316)

Possibly related PRs

  • Pin numpy<2 #273: Updates setup.py to remove the upper limit on the numpy dependency, directly related to dependency management.

Poem

In the garden where bunnies play,
New versions hop in, brightening the day.
With Python's best, we leap and bound,
Dependencies freed, joyfully found!
So let's celebrate, with a twitch of our nose,
For every change, our excitement grows! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 856a1c7 and 094abf3.

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • setup.py (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • setup.py

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (2)
setup.py (2)

55-55: Approve numpy dependency update, but consider version range

Removing the upper version limit for numpy allows for compatibility with future releases, which aligns with the PR objectives. However, this approach may introduce potential compatibility issues if future numpy versions include breaking changes.

Consider using a more conservative approach by specifying a minimum version and allowing for minor updates:

-            "numpy",
+            "numpy>=1.20,<2",

This ensures compatibility with recent numpy versions while protecting against potential breaking changes in major releases.


75-75: Approve Python version update and suggest classifier update

The change to require Python 3.10 or higher aligns with the PR objectives and practices of related libraries. This is a breaking change that drops support for Python 3.9.

To maintain consistency, please update the classifiers to reflect the new minimum Python version:

         classifiers=[
             "Programming Language :: Python :: 3",
-            "Programming Language :: Python :: 3.9",
             "Programming Language :: Python :: 3.10",
             "Programming Language :: Python :: 3.11",
             "Programming Language :: Python :: 3.12",
             # ... other classifiers ...
         ],
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 62079a3 and 856a1c7.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (1 hunks)
  • setup.py (3 hunks)
🔇 Additional comments (2)
setup.py (2)

11-11: Approve date update, but query future date usage

The date has been appropriately updated to reflect the latest changes. However, both the old and new dates are set in the future.

Could you clarify why future dates are being used? Typically, the __date__ field should reflect the actual release date, not a planned future date. Consider using the current date or leaving it blank until the actual release.


57-57: Approve pymatgen dependency update

Removing the upper version limit for pymatgen allows for compatibility with future releases. This change directly addresses the concern raised in issue #316 regarding the necessity of the upper version pin.

This change aligns well with the project's goal of improving compatibility with the latest pymatgen releases. However, be prepared to monitor for any potential compatibility issues that may arise with future pymatgen updates.

@@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9","3.10","3.11","3.12"]
python-version: ["3.10","3.11","3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Update Documentation to Reflect Python 3.10+ Requirement

The README currently states that the project is tested using Python 3.9+, which conflicts with the CI workflow where Python 3.9 has been removed from the test matrix. Please update the README to specify that the project requires Python 3.10 or higher to ensure consistency and clarity for users.

🔗 Analysis chain

Approved: Python version matrix update aligns with PR objectives

The removal of Python 3.9 from the test matrix is consistent with the PR's goal of dropping support for Python 3.9 and aligning with pymatgen and other NumFOCUS stack libraries. This change appropriately reflects the new minimum Python version requirement of 3.10.

To ensure this change is properly documented, please run the following script:

If the script doesn't return any results or shows outdated information, please update the project's README or documentation to clearly state the new minimum Python version requirement.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the README or documentation has been updated to reflect the new Python version requirement.

# Test: Search for mentions of Python version requirements
rg --type md --type rst "Python (version|>=|>|3\.(9|10))"

Length of output: 138

setup.py Outdated
@@ -5,10 +5,10 @@
__copyright__ = (
"Copyright Daniel W. Davies, Adam J. Jackson, Keith T. Butler (2019)"
)
__version__ = "2.7"
__version__ = "2.7.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Consider a major version increment for breaking changes

The version number has been updated from 2.7 to 2.7.1, which typically indicates a patch release. However, the PR description mentions a breaking change (dropping support for Python 3.9). Breaking changes usually warrant a major version increment.

Consider updating the version to 3.0.0 to reflect the breaking change:

-__version__ = "2.7.1"
+__version__ = "3.0.0"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
__version__ = "2.7.1"
__version__ = "3.0.0"

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.46%. Comparing base (62079a3) to head (094abf3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #318   +/-   ##
=======================================
  Coverage   76.46%   76.46%           
=======================================
  Files          26       26           
  Lines        2265     2265           
=======================================
  Hits         1732     1732           
  Misses        533      533           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AntObi AntObi merged commit c2f47ff into WMD-group:master Sep 26, 2024
13 checks passed
@AntObi AntObi deleted the bump3.10 branch September 26, 2024 21:31
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.

Can the upper pin on pymatgen be removed?
1 participant