Skip to content

Commit 80abfc5

Browse files
wanghan-iapcmHan Wangpre-commit-ci[bot]njzjz
authored
chore: drop Python 3.8/3.9 support, bump minimum to 3.10 (#958)
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. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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/CD workflows and test matrix to target current Python versions. * Removed legacy compatibility dependency markers and simplified optional dependencies. * **Documentation** * Updated installation and README to reflect Python 3.10+ requirement. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Han Wang <wang_han@iapcm.ac.cn> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
1 parent 26171f2 commit 80abfc5

File tree

12 files changed

+23
-23
lines changed

12 files changed

+23
-23
lines changed

.github/workflows/pub-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@master
1212

13-
- name: Set up Python 3.9
13+
- name: Set up Python 3.10
1414
uses: actions/setup-python@master
1515
with:
16-
python-version: 3.9
16+
python-version: "3.10"
1717

1818
- name: Install pypa/build
1919
run: >-

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-22.04
1010
strategy:
1111
matrix:
12-
python-version: ["3.8", "3.12"]
12+
python-version: ["3.10", "3.13"]
1313

1414
steps:
1515
- uses: actions/checkout@v6

.github/workflows/test_import.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v6
1212
- uses: actions/setup-python@v6
1313
with:
14-
python-version: '3.9'
14+
python-version: '3.10'
1515
architecture: 'x64'
1616
- run: python -m pip install uv
1717
- run: python -m uv pip install --system .

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you use this software, please cite the following paper:
1515

1616
## Installation
1717

18-
dpdata only supports Python 3.8 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install dpdata:
18+
dpdata only supports Python 3.10 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install dpdata:
1919

2020
- Install via pip: `pip install dpdata`
2121
- Install via conda: `conda install -c conda-forge dpdata`

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Installation
22

3-
dpdata only supports Python 3.8 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install dpdata:
3+
dpdata only supports Python 3.10 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install dpdata:
44

55
- Install via pip: `pip install dpdata`
66
- Install via conda: `conda install -c conda-forge dpdata`

dpdata/driver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
from __future__ import annotations
44

55
from abc import ABC, abstractmethod
6-
from typing import TYPE_CHECKING, Callable
6+
from typing import TYPE_CHECKING
77

88
from .plugin import Plugin
99

1010
if TYPE_CHECKING:
11+
from collections.abc import Callable
12+
1113
import ase.calculators.calculator
1214

1315

dpdata/plugins/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
from __future__ import annotations
22

33
import importlib
4+
from importlib import metadata
45
from pathlib import Path
56

6-
try:
7-
from importlib import metadata
8-
except ImportError: # for Python<3.8
9-
import importlib_metadata as metadata
10-
117
PACKAGE_BASE = "dpdata.plugins"
128
NOT_LOADABLE = ("__init__.py",)
139

dpdata/plugins/ase.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import os
4-
from typing import TYPE_CHECKING, Generator
4+
from typing import TYPE_CHECKING
55

66
import numpy as np
77

@@ -10,6 +10,8 @@
1010
from dpdata.format import Format
1111

1212
if TYPE_CHECKING:
13+
from collections.abc import Generator
14+
1315
import ase
1416
from ase.optimize.optimize import Optimizer
1517

dpdata/system.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from typing import (
1111
TYPE_CHECKING,
1212
Any,
13-
Iterable,
1413
Literal,
1514
overload,
1615
)
@@ -37,6 +36,8 @@
3736
)
3837

3938
if TYPE_CHECKING:
39+
from collections.abc import Iterable
40+
4041
import parmed
4142

4243

dpdata/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import io
44
import os
55
from contextlib import contextmanager
6-
from typing import TYPE_CHECKING, Generator, Literal, overload
6+
from typing import TYPE_CHECKING, Literal, overload
77

88
import numpy as np
99

@@ -130,6 +130,8 @@ def utf8len(s: str) -> int:
130130

131131

132132
if TYPE_CHECKING:
133+
from collections.abc import Generator
134+
133135
FileType = io.IOBase | str | os.PathLike
134136

135137

0 commit comments

Comments
 (0)