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

Use typing_extensions only on Python 3.7 and lower #504

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion janus/__init__.py
Expand Up @@ -9,7 +9,11 @@
from queue import Full as SyncQueueFull
from typing import Any, Callable, Deque, Generic, List, Optional, Set, TypeVar

from typing_extensions import Protocol
try:
# Python 3.8+
from typing import Protocol
except ImportError:
from typing_extensions import Protocol
Copy link
Member

Choose a reason for hiding this comment

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

Files skipped (0):
[46](https://github.com/aio-libs/janus/actions/runs/4158352254/jobs/7329564730?pr=504#step:6:47)
mypy janus --disallow-untyped-calls --disallow-incomplete-defs --strict
[47](https://github.com/aio-libs/janus/actions/runs/4158352254/jobs/7329564730?pr=504#step:6:48)
janus/__init__.py:16: error: Incompatible import of "Protocol" (imported name has type "typing_extensions._SpecialForm", local name has type "<typing special form>")  [assignment]
[48](https://github.com/aio-libs/janus/actions/runs/4158352254/jobs/7329564730?pr=504#step:6:49)
Found 1 error in 1 file (checked 1 source file)
[49](https://github.com/aio-libs/janus/actions/runs/4158352254/jobs/7329564730?pr=504#step:6:50)
make: *** [Makefile:31: mypy] Error 1
[50](https://github.com/aio-libs/janus/actions/runs/4158352254/jobs/7329564730?pr=504#step:6:51)
Error: Process completed with exit code 2.

linter issue needs to be addressed.

Copy link
Author

Choose a reason for hiding this comment

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

yeah, i have no clue how to fix that - obviously they're not gonna be the same type, but they have the same API


__version__ = "1.0.0"
__all__ = (
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -47,7 +47,7 @@ zip_safe = True
include_package_data = True

install_requires =
typing-extensions>=3.7.4.3
typing-extensions>=3.7.4.3;python_version<"3.8"

[flake8]
exclude = .git,.env,__pycache__,.eggs
Expand Down