Skip to content

Commit 547933d

Browse files
authored
Require typing-extensions on py<3.8 only (#269)
typing.Literal is available since Python 3.8. Use it instead of requiring typing-extensions for systems that no longer have Python 3.7.
1 parent 8ed5687 commit 547933d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pytest_asyncio/plugin.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import functools
66
import inspect
77
import socket
8+
import sys
89
import warnings
910
from typing import (
1011
Any,
@@ -24,7 +25,11 @@
2425
)
2526

2627
import pytest
27-
from typing_extensions import Literal
28+
29+
if sys.version_info >= (3, 8):
30+
from typing import Literal
31+
else:
32+
from typing_extensions import Literal
2833

2934
_R = TypeVar("_R")
3035

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ setup_requires =
3939

4040
install_requires =
4141
pytest >= 6.1.0
42-
typing-extensions >= 4.0
42+
typing-extensions >= 4.0; python_version < "3.8"
4343

4444
[options.extras_require]
4545
testing =

0 commit comments

Comments
 (0)