Skip to content

Commit

Permalink
FIX: import Literal from typing_extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Mar 3, 2024
1 parent e830644 commit 10b4d5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies = [
"particle",
"python-constraint",
"tqdm >=4.24.0", # autonotebook
'typing-extensions; python_version <"3.10.0"', # typing.TypeAlias
'typing-extensions; python_version <"3.10.0"', # Literal, Protocol, TypeAlias
]
description = "Rule-based particle reaction problem solver on a quantum number level"
dynamic = ["version"]
Expand Down
7 changes: 6 additions & 1 deletion src/qrules/transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from copy import copy, deepcopy
from enum import Enum, auto
from multiprocessing import Pool
from typing import TYPE_CHECKING, Iterable, Literal, Sequence, overload
from typing import TYPE_CHECKING, Iterable, Sequence, overload

import attrs
from attrs import define, field, frozen
Expand Down Expand Up @@ -74,6 +74,11 @@
create_n_body_topology,
)

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal

Check warning on line 80 in src/qrules/transition.py

View check run for this annotation

Codecov / codecov/patch

src/qrules/transition.py#L80

Added line #L80 was not covered by tests

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
Expand Down

0 comments on commit 10b4d5f

Please sign in to comment.