Skip to content

Commit 9e826ba

Browse files
committed
MAINT: remove typing backward compatibility with Python < 3.9
We support typing only with Python >= 3.9.
1 parent 19c72bf commit 9e826ba

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

mesonpy/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@
5757

5858

5959
if typing.TYPE_CHECKING: # pragma: no cover
60-
from typing import Any, Callable, ClassVar, DefaultDict, List, Optional, Sequence, TextIO, Tuple, Type, TypeVar, Union
60+
from typing import (
61+
Any, Callable, ClassVar, DefaultDict, List, Literal, Optional, Sequence, TextIO, Tuple, Type, TypeVar, Union
62+
)
6163

62-
from mesonpy._compat import Iterator, Literal, ParamSpec, Path
64+
from mesonpy._compat import Iterator, ParamSpec, Path
6365

6466
P = ParamSpec('P')
6567
T = TypeVar('T')

mesonpy/_compat.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ def read_binary(package: str, resource: str) -> bytes:
4141
else:
4242
from typing_extensions import ParamSpec
4343

44-
if sys.version_info >= (3, 8):
45-
from typing import Literal
46-
else:
47-
from typing_extensions import Literal
48-
4944
Path = Union[str, os.PathLike]
5045

5146

@@ -65,7 +60,6 @@ def is_relative_to(path: pathlib.Path, other: Union[pathlib.Path, str]) -> bool:
6560
'Collection',
6661
'Iterable',
6762
'Iterator',
68-
'Literal',
6963
'Mapping',
7064
'Path',
7165
'ParamSpec',

0 commit comments

Comments
 (0)