mirror of
https://github.com/certbot/certbot.git
synced 2026-07-30 16:14:44 +02:00
Use typing-extensions to ensure certbot dev environment is compatible with Python 3.6/3.7 (#8776)
Fixes #8773 I took option 2 from the issue mentionned above (importing `typing-extensions` on dev dependencies) to avoid modifying certbot runtime requirements given that what needs to be added is useful for mypy only. I did not change the Python version used to execute the linting and mypy on the standard tests, given that the tox `docker_dev` target already checks if the development environment is working for Python < 3.8.
This commit is contained in:
@@ -12,7 +12,7 @@ from certbot.tests import acme_util
|
||||
from certbot.tests import util as test_util
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from typing import Protocol
|
||||
from typing_extensions import Protocol
|
||||
else:
|
||||
Protocol = object # type: ignore
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ try:
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock # type: ignore
|
||||
if typing.TYPE_CHECKING:
|
||||
from typing import Protocol
|
||||
from typing_extensions import Protocol
|
||||
else:
|
||||
Protocol = object # type: ignore
|
||||
|
||||
|
||||
@@ -77,6 +77,9 @@ dev_extras = [
|
||||
'pytest',
|
||||
'pytest-cov',
|
||||
'pytest-xdist',
|
||||
# typing-extensions is required to import typing.Protocol and make the mypy checks
|
||||
# pass (along with pylint about non-existent objects) on Python 3.6 & 3.7
|
||||
'typing-extensions',
|
||||
'tox',
|
||||
'twine',
|
||||
'wheel',
|
||||
|
||||
Reference in New Issue
Block a user