Skip to content

chore: drop Python 3.8/3.9 support, bump minimum to 3.10#958

Merged
njzjz merged 6 commits intodeepmodeling:masterfrom
wanghan-iapcm:fix-py-to-310
Mar 23, 2026
Merged

chore: drop Python 3.8/3.9 support, bump minimum to 3.10#958
njzjz merged 6 commits intodeepmodeling:masterfrom
wanghan-iapcm:fix-py-to-310

Conversation

@wanghan-iapcm
Copy link
Copy Markdown
Contributor

@wanghan-iapcm wanghan-iapcm commented Mar 23, 2026

Python 3.8 reached EOL in October 2024 and 3.9 in October 2025. The lmdb package is also broken on Python 3.8 CI runners. Update classifiers, requires-python, CI matrix, docs, and remove legacy Python <3.8 fallbacks.

Summary by CodeRabbit

  • Chores

    • Raised minimum supported Python to 3.10 and removed older 3.8/3.9 support.
    • Added official support for newer Python versions (including 3.12/3.13).
    • Updated CI workflows and test matrix to target current Python versions.
    • Simplified compatibility markers and optional dependency declarations.
    • Adjusted internal compatibility imports to align with newer Python runtimes.
  • Documentation

    • Updated installation docs and README to reflect Python 3.10+ requirement.

Python 3.8 reached EOL in October 2024 and 3.9 in October 2025.
The lmdb package is also broken on Python 3.8 CI runners.
Update classifiers, requires-python, CI matrix, docs, and remove
legacy Python <3.8 fallbacks.
@wanghan-iapcm wanghan-iapcm requested a review from njzjz March 23, 2026 04:13
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 23, 2026
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. dependencies Pull requests that update a dependency file dpdata and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Mar 23, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 23, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 2 untouched benchmarks


Comparing wanghan-iapcm:fix-py-to-310 (ee3221a) with master (26171f2)

Open in CodSpeed

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2d69a21-0687-46f0-a3fd-4a0a119d4257

📥 Commits

Reviewing files that changed from the base of the PR and between 59f86e2 and ee3221a.

📒 Files selected for processing (4)
  • dpdata/driver.py
  • dpdata/plugins/ase.py
  • dpdata/system.py
  • dpdata/utils.py

📝 Walkthrough

Walkthrough

Raises the minimum supported Python to 3.10 across packaging, docs, and CI; updates CI matrices and workflow Python versions; removes legacy importlib_metadata/typing_extensions conditionals; and moves several typing imports to collections.abc or to TYPE_CHECKING-only imports.

Changes

Cohort / File(s) Summary
Configuration & Packaging
pyproject.toml, tests/plugin/pyproject.toml, .github/workflows/test.yml, .github/workflows/pub-pypi.yml, .github/workflows/test_import.yml
Bumped requires-python to >=3.10, updated PyPI classifiers (removed 3.8/3.9, added 3.12/3.13), removed conditional importlib_metadata/typing_extensions markers, simplified optional extras, and updated CI workflow Python versions/test matrix.
Documentation
README.md, docs/installation.md
Updated installation/docs to state Python 3.10+ as the minimum supported Python version.
Typing import modernizations
dpdata/driver.py, dpdata/plugins/ase.py, dpdata/system.py, dpdata/utils.py
Moved Callable/Generator/Iterable type imports to collections.abc or into TYPE_CHECKING guards, removing runtime dependency on older typing exports; no runtime behavior or public APIs changed.
Plugin system import
dpdata/plugins/__init__.py
Removed fallback to external importlib_metadata; now imports metadata from the stdlib importlib unconditionally.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • njzjz
  • wanghan-iapcm
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and clearly summarizes the main change: dropping Python 3.8/3.9 support and bumping the minimum supported version to 3.10, which aligns with all the changeset modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.63%. Comparing base (26171f2) to head (ee3221a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #958      +/-   ##
==========================================
+ Coverage   86.37%   86.63%   +0.26%     
==========================================
  Files          86       86              
  Lines        8086     8006      -80     
==========================================
- Hits         6984     6936      -48     
+ Misses       1102     1070      -32     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
dpdata/plugins/__init__.py (1)

16-19: Consider removing the now-unnecessary try/except block.

The group parameter for metadata.entry_points() was added in Python 3.10. Since this PR raises the minimum Python version to 3.10, the TypeError fallback path will never be executed.

♻️ Suggested simplification
-try:
-    eps = metadata.entry_points(group="dpdata.plugins")
-except TypeError:
-    eps = metadata.entry_points().get("dpdata.plugins", [])
+eps = metadata.entry_points(group="dpdata.plugins")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dpdata/plugins/__init__.py` around lines 16 - 19, Remove the now-unnecessary
try/except around metadata.entry_points: directly call
metadata.entry_points(group="dpdata.plugins") and assign its result to eps
(remove the TypeError fallback that calls
metadata.entry_points().get("dpdata.plugins", [])). Update references to eps as
before; the unique symbol to change is the metadata.entry_points call that
currently lives in the try block and the eps assignment that follows.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@dpdata/plugins/__init__.py`:
- Around line 16-19: Remove the now-unnecessary try/except around
metadata.entry_points: directly call
metadata.entry_points(group="dpdata.plugins") and assign its result to eps
(remove the TypeError fallback that calls
metadata.entry_points().get("dpdata.plugins", [])). Update references to eps as
before; the unique symbol to change is the metadata.entry_points call that
currently lives in the try block and the eps assignment that follows.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4c38ed86-2283-4621-96f7-a5c12d0ddcd1

📥 Commits

Reviewing files that changed from the base of the PR and between 26171f2 and 13ac005.

📒 Files selected for processing (10)
  • .github/workflows/test.yml
  • README.md
  • docs/installation.md
  • dpdata/driver.py
  • dpdata/plugins/__init__.py
  • dpdata/plugins/ase.py
  • dpdata/system.py
  • dpdata/utils.py
  • pyproject.toml
  • tests/plugin/pyproject.toml

@njzjz njzjz enabled auto-merge (squash) March 23, 2026 06:52
@njzjz njzjz merged commit 80abfc5 into deepmodeling:master Mar 23, 2026
9 of 10 checks passed
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 dpdata size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants