-
Notifications
You must be signed in to change notification settings - Fork 50
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
Drop Python 3.9 support #709
base: master
Are you sure you want to change the base?
Drop Python 3.9 support #709
Conversation
WalkthroughThe changes include updates to Python version requirements across multiple configuration files, enhancements to the GitHub Actions workflow, and formatting improvements in various test files. The workflow's Python version matrix was updated to support Python 3.10, and the Codecov action was upgraded from version 3 to version 4. Additionally, the minimum Python version in Changes
Possibly related PRs
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This reverts commit b100e39.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #709 +/- ##
==========================================
- Coverage 82.57% 82.51% -0.07%
==========================================
Files 27 27
Lines 1584 1584
Branches 284 284
==========================================
- Hits 1308 1307 -1
- Misses 215 216 +1
Partials 61 61 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (15)
- .github/workflows/test.yml (2 hunks)
- README.md (1 hunks)
- pylintrc (1 hunks)
- pyproject.toml (5 hunks)
- tasks.py (1 hunks)
- tests/test_collections.py (1 hunks)
- tests/test_design_patterns.py (1 hunks)
- tests/test_dev.py (1 hunks)
- tests/test_fractions.py (1 hunks)
- tests/test_functools.py (1 hunks)
- tests/test_io.py (1 hunks)
- tests/test_json.py (1 hunks)
- tests/test_os.py (1 hunks)
- tests/test_shutil.py (9 hunks)
- tests/test_tempfile.py (1 hunks)
Files skipped from review due to trivial changes (13)
- README.md
- pylintrc
- tasks.py
- tests/test_collections.py
- tests/test_design_patterns.py
- tests/test_dev.py
- tests/test_fractions.py
- tests/test_functools.py
- tests/test_io.py
- tests/test_json.py
- tests/test_os.py
- tests/test_shutil.py
- tests/test_tempfile.py
Additional comments not posted (7)
.github/workflows/test.yml (3)
8-8
: Approved:fail-fast
strategy set to false.This change allows all jobs to run to completion, providing a complete picture of all test failures.
12-12
: Approved: Updated Python version matrix.The inclusion of Python 3.10 and removal of 3.9 aligns with the objective to drop Python 3.9 support.
33-33
: Approved: Codecov action updated to v4.Ensure to verify any changes in behavior or new features introduced by the new version.
pyproject.toml (4)
12-12
: Approved: Updated minimum Python version to 3.10.This change aligns with the objective to drop support for Python 3.9.
30-30
: Approved: Simplifiednumpy
version constraint.The constraint
numpy<2
ensures compatibility with versions below 2.0 while simplifying the versioning.
37-37
: Approved: Addedpydantic
as a dependency.This addition suggests enhanced data validation or settings management capabilities.
54-54
: Approved: Updatedblack
target version topy310
.This change aligns the formatting tools with the updated Python version requirement.
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
.github/workflows/test.yml (2)
12-12
: LGTM! Consider adding Python 3.11 to the test matrix.The update to drop Python 3.9 support and use 3.10 as the minimum version is consistent with the PR objectives and other file updates. It's good to test against both the minimum (3.10) and latest (3.12) supported versions.
Consider adding Python 3.11 to the test matrix as well. This would provide better coverage across supported Python versions:
- python-version: ["3.10", "3.12"] + python-version: ["3.10", "3.11", "3.12"]
Line range hint
1-35
: Consider adding dependency caching to improve workflow efficiency.While the current workflow configuration is good, you could further optimize it by implementing dependency caching. This can significantly reduce the time it takes to install dependencies, especially for larger projects.
Here's a suggestion to add caching:
steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Cache pip packages uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Install dependencies run: | python -m pip install --upgrade pip pip install -e '.[ci]'This change would cache the pip packages based on the contents of your requirements file, potentially speeding up subsequent runs.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- .github/workflows/test.yml (2 hunks)
- pyproject.toml (4 hunks)
- tests/test_json.py (1 hunks)
🧰 Additional context used
🪛 Ruff
tests/test_json.py
50-50: Redefinition of unused
pytest
from line 12Remove definition:
pytest
(F811)
53-53: Redefinition of unused
MontyDecoder
from line 15Remove definition:
MontyDecoder
(F811)
54-54: Redefinition of unused
MontyEncoder
from line 16Remove definition:
MontyEncoder
(F811)
55-55: Redefinition of unused
MSONable
from line 17Remove definition:
MSONable
(F811)
56-56: Redefinition of unused
_load_redirect
from line 18Remove definition:
_load_redirect
(F811)
57-57: Redefinition of unused
jsanitize
from line 19Remove definition:
jsanitize
(F811)
58-58: Redefinition of unused
load
from line 20Remove definition:
load
(F811)
61-61:
.__version__
imported but unusedRemove unused import:
.__version__
(F401)
🔇 Additional comments (5)
.github/workflows/test.yml (1)
33-33
: LGTM! Codecov action updated to v4.The update of the Codecov action to version 4 is in line with the PR objectives and follows good practices of keeping GitHub Actions up to date.
pyproject.toml (4)
12-12
: LGTM: Python version requirement updated correctly.The change from
>=3.9
to>=3.10
aligns with the PR objective of dropping Python 3.9 support and is consistent with the changes made in the GitHub Actions workflow configuration.
70-70
: LGTM: Black configuration updated correctly.The update of
target-version
from['py39']
to["py310"]
in the Black configuration aligns with the new Python version requirement. This ensures that Black uses the appropriate Python version for formatting.
110-117
: LGTM: Ruff configuration restructured correctly.The Ruff configuration has been appropriately restructured:
- The
[tool.ruff.lint]
section with theselect
field has been added.- The
[tool.ruff.lint.isort]
section now contains therequired-imports
andknown-first-party
fields.This restructuring improves clarity and follows best practices for Ruff configuration while preserving the previous settings.
Line range hint
1-117
: Overall changes look good, with a few points to address.The
pyproject.toml
file has been successfully updated to reflect the new Python version requirement and improve project configuration. However, there are two main points that need attention:
- The NumPy version constraint (
numpy<2
) contradicts the PR objective of supporting NumPy 2.x. This needs to be adjusted.- The addition of
torch
as an optional dependency, given the mentioned compatibility issues with NumPy on Windows, requires further investigation.Please address these points to ensure the configuration aligns fully with the PR objectives and doesn't introduce new complications.
To investigate the PyTorch and NumPy compatibility issue on Windows, run the following script:
#!/bin/bash # Description: Check for PyTorch and NumPy usage and potential compatibility issues echo "PyTorch imports in the project:" rg 'import.*torch' echo "\nNumPy imports in the project:" rg 'import.*numpy' echo "\nFiles containing both PyTorch and NumPy imports:" rg -l 'import.*torch' | xargs rg -l 'import.*numpy' echo "\nPotential compatibility checks or warnings:" rg -i 'compatibility|warning|numpy.*torch|torch.*numpy'This script will help identify areas where PyTorch and NumPy are used together, potentially highlighting locations where compatibility issues might arise.
@@ -85,26 +84,24 @@ branch = true | |||
exclude_also = [ | |||
"@deprecated", | |||
"def __repr__", | |||
"if 0:", | |||
"if __name__ == .__main__.:", |
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.
I didn't find any of these across the code base, so assume safe to remove
Summary