Skip to content

Commit

Permalink
Require typing-extensions on py<3.8 only (#269)
Browse files Browse the repository at this point in the history
typing.Literal is available since Python 3.8.  Use it instead of
requiring typing-extensions for systems that no longer have Python 3.7.
  • Loading branch information
mgorny committed Jan 17, 2022
1 parent 8ed5687 commit 547933d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pytest_asyncio/plugin.py
Expand Up @@ -5,6 +5,7 @@
import functools
import inspect
import socket
import sys
import warnings
from typing import (
Any,
Expand All @@ -24,7 +25,11 @@
)

import pytest
from typing_extensions import Literal

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

_R = TypeVar("_R")

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -39,7 +39,7 @@ setup_requires =

install_requires =
pytest >= 6.1.0
typing-extensions >= 4.0
typing-extensions >= 4.0; python_version < "3.8"

[options.extras_require]
testing =
Expand Down

0 comments on commit 547933d

Please sign in to comment.