-
Notifications
You must be signed in to change notification settings - Fork 137
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
breaking: drop python 3.7 #783
Conversation
📝 WalkthroughWalkthroughThis pull request focuses on updating the project's Python version support from Python 3.7 to Python 3.8 and above. The changes span multiple files, including workflow configurations, documentation, and project configuration files. The modifications remove Python 3.7 support across GitHub Actions workflow, installation documentation, import statements, and project metadata. The changes ensure consistent Python version requirements and simplify type-related imports by leveraging Python 3.8+ features. Changes
Possibly related PRs
Suggested reviewers
Finishing Touches
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 (
|
for more information, see https://pre-commit.ci
CodSpeed Performance ReportMerging #783 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #783 +/- ##
==========================================
- Coverage 85.16% 85.13% -0.03%
==========================================
Files 81 81
Lines 7530 7535 +5
==========================================
+ Hits 6413 6415 +2
- Misses 1117 1120 +3 ☔ 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
🔭 Outside diff range comments (2)
pyproject.toml (2)
Line range hint
26-27
: Clean up Python < 3.8 conditional dependencies.Since Python 3.7 support is being dropped, these conditional dependencies for Python < 3.8 can be removed:
- 'importlib_metadata>=1.4; python_version < "3.8"', - 'typing_extensions; python_version < "3.8"',
Line range hint
44-47
: Clean up Python < 3.8 conditional dependency in amber extras.Since Python 3.7 support is being dropped, this conditional dependency for Python < 3.8 can be simplified:
- 'parmed; python_version >= "3.8"', - 'parmed<4; python_version < "3.8"', + 'parmed',
🧹 Nitpick comments (2)
dpdata/stat.py (2)
119-119
: Keep the explicit @lru_cache() form.While both forms work in Python 3.8+, the explicit
@lru_cache()
form is more commonly used and makes it clear that this is a function call. Consider reverting this change:- @lru_cache + @lru_cache()Also applies to: 127-127, 156-156, 169-169
🧰 Tools
🪛 Ruff (0.8.2)
119-119: Use of
functools.lru_cache
orfunctools.cache
on methods can lead to memory leaks(B019)
119-119
: Consider alternatives to @lru_cache on methods.Using
@lru_cache
on instance methods can lead to memory leaks as the cache is tied to the instance lifetime. Consider these alternatives:
- Move the cache to class level using a shared cache pattern
- Use
@property
without caching if the computation is lightweight- Implement manual caching with instance-level cache clearing
Would you like me to provide an example implementation of any of these alternatives?
Also applies to: 127-127, 156-156, 169-169
🧰 Tools
🪛 Ruff (0.8.2)
119-119: Use of
functools.lru_cache
orfunctools.cache
on methods can lead to memory leaks(B019)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.github/workflows/test.yml
(1 hunks)docs/installation.md
(1 hunks)docs/make_format.py
(1 hunks)dpdata/stat.py
(3 hunks)dpdata/system.py
(1 hunks)dpdata/utils.py
(1 hunks)pyproject.toml
(1 hunks)tests/plugin/pyproject.toml
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- dpdata/system.py
🧰 Additional context used
🪛 Ruff (0.8.2)
dpdata/stat.py
119-119: Use of functools.lru_cache
or functools.cache
on methods can lead to memory leaks
(B019)
127-127: Use of functools.lru_cache
or functools.cache
on methods can lead to memory leaks
(B019)
156-156: Use of functools.lru_cache
or functools.cache
on methods can lead to memory leaks
(B019)
169-169: Use of functools.lru_cache
or functools.cache
on methods can lead to memory leaks
(B019)
🔇 Additional comments (6)
dpdata/utils.py (1)
6-6
: LGTM! Clean import update for Python 3.8+The direct import of
Literal
fromtyping
is appropriate as Python 3.8+ is now the minimum supported version.docs/make_format.py (1)
7-7
: LGTM! Simplified type importClean removal of version-specific imports now that Python 3.8+ is required.
tests/plugin/pyproject.toml (1)
14-14
: LGTM! Updated Python version requirementThe Python version requirement has been correctly updated to align with the project's new minimum version requirement.
docs/installation.md (1)
3-3
: LGTM! Documentation accurately updatedThe documentation has been correctly updated to:
- Reflect the new minimum Python version requirement
- Fix the package name from "DP-GEN" to "dpdata"
.github/workflows/test.yml (1)
12-12
: LGTM! Python version matrix updated correctly.The Python version matrix has been properly updated to remove Python 3.7, aligning with the PR objective.
pyproject.toml (1)
30-30
: LGTM! Python version requirement updated correctly.The Python version requirement has been properly updated to ">=3.8", aligning with the PR objective.
Summary by CodeRabbit
Release Notes
Python Version Support
Documentation
Code Maintenance
Build Configuration