ask / mode

Python AsyncIO Services
Other
240 stars 55 forks source link

Missing import: typing_extensions #53

Closed austinnichols101 closed 4 years ago

austinnichols101 commented 4 years ago

Versions 4.1.4 through 4.1.6 are missing an import statement for typing_extensions. The problem was introduced with commit 3d15d1efcedaf0ea20a185ceae5b97e35ac4bac9.

Here is an example of a Faust 1.8.1 application running under python 3.7.3 with mode 4.1.6 demonstrating the error:

Start the faust worker...
Traceback (most recent call last):
  File "/usr/local/bin/faust", line 5, in <module>
    from faust.cli.faust import cli
  File "/usr/local/lib/python3.7/dist-packages/faust/cli/__init__.py", line 2, in <module>
    from .base import AppCommand, Command, argument, call_command, option
  File "/usr/local/lib/python3.7/dist-packages/faust/cli/base.py", line 34, in <module>
    from mode import Service, ServiceT, Worker
  File "/usr/local/lib/python3.7/dist-packages/mode/__init__.py", line 127, in __getattr__
    object_origins[name], None, None, [name])
  File "/usr/local/lib/python3.7/dist-packages/mode/services.py", line 31, in <module>
    from .timers import timer_intervals
  File "/usr/local/lib/python3.7/dist-packages/mode/timers.py", line 5, in <module>
    from .utils.logging import get_logger
  File "/usr/local/lib/python3.7/dist-packages/mode/utils/logging.py", line 48, in <module>
    from typing_extensions import Protocol
ModuleNotFoundError: No module named 'typing_extensions'
tanbot commented 4 years ago

We get the same error under Python 3.8.0. Changing the line to: from typing import Protocol fixes the issue under Python 3.8.0.

davidzhao commented 4 years ago

typing_extensions was introduced in this commit: https://github.com/ask/mode/commit/3d15d1efcedaf0ea20a185ceae5b97e35ac4bac9#diff-05f65f01868242771df4df44cae4d67eR47

We use faust and our build just broke due to this undeclared dependency.

ask commented 4 years ago

Oops! Somehow I thought this was the same as mypy_extensions. Fixed now, will publish a new version 4.1.7

davidzhao commented 4 years ago

thanks for the speedy resolution!