Skip to content

Commit

Permalink
import Literal from typing_extensions for py37
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Sep 11, 2023
1 parent 08465e4 commit 6ac8f44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion deepmd/infer/model_devi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
Literal,
Optional,
Tuple,
overload,
Expand All @@ -22,6 +21,11 @@
DeepPot,
)

try:
from typing import Literal # python >=3.8
except ImportError:
from typing_extensions import Literal # type: ignore


@overload
def calc_model_devi_f(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies = [
'pyyaml',
'dargs >= 0.3.5',
'python-hostlist >= 1.21',
'typing_extensions; python_version < "3.7"',
'typing_extensions; python_version < "3.8"',
'importlib_metadata>=1.4; python_version < "3.8"',
'h5py',
'wcmatch',
Expand Down

0 comments on commit 6ac8f44

Please sign in to comment.