Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the typing_extensions runtime dependency version #641

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion proxy/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@
"""
import queue
import ipaddress
import sys

from typing import TYPE_CHECKING, Dict, Any, List, Union

from typing_extensions import Protocol
# NOTE: Using try/except causes linting problems which is why it's necessary
# NOTE: to use this mypy/pylint idiom for py36-py38 compatibility
# Ref: https://github.com/python/typeshed/issues/3500#issuecomment-560958608
if sys.version_info >= (3, 8):
from typing import Protocol
else:
from typing_extensions import Protocol
Comment on lines +17 to +23
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you :). Was totally unnecessary to include typings for all future Python versions


if TYPE_CHECKING:
DictQueueType = queue.Queue[Dict[str, Any]] # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
typing-extensions==3.10.0.2
typing-extensions==3.10.0.2; python_version < "3.8"
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
zip_safe=False,
packages=find_packages(exclude=['tests', 'tests.*']),
package_data={'proxy': ['py.typed']},
install_requires=open('requirements.txt', 'r').read().strip().split(),
install_requires=[
'typing-extensions; python_version < "3.8"',
],
entry_points={
'console_scripts': [
'proxy = proxy:entry_point'
Expand Down