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

a2wsgi needs typing_extensions on older Python versions #52

Open
encukou opened this issue Apr 23, 2024 · 2 comments · May be fixed by #57
Open

a2wsgi needs typing_extensions on older Python versions #52

encukou opened this issue Apr 23, 2024 · 2 comments · May be fixed by #57

Comments

@encukou
Copy link

encukou commented Apr 23, 2024

Hello,
Thank you for a2wsgi!
I found a packaging issue on Python 3.10 and lower:

asgi_typing.py has:

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

However, typing_extensions is not listed as a runtime requirement. If a2wsgi is installed without its test dependencies, it fails to import:

$ pip install a2wsgi
[...]
Successfully installed a2wsgi-1.10.4

$ python
Python 3.8.19 (default, Mar 20 2024, 00:00:00) 
[GCC 13.2.1 20240316 (Red Hat 13.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import a2wsgi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../python3.8/site-packages/a2wsgi/__init__.py", line 1, in <module>
    from .asgi import ASGIMiddleware
  File ".../python3.8/site-packages/a2wsgi/asgi.py", line 9, in <module>
    from .asgi_typing import HTTPScope, ASGIApp, ReceiveEvent, SendEvent
  File ".../python3.8/site-packages/a2wsgi/asgi_typing.py", line 21, in <module>
    from typing_extensions import NotRequired
ModuleNotFoundError: No module named 'typing_extensions'
>>> 
@abersheeran
Copy link
Owner

Welcome PR

encukou added a commit to encukou/a2wsgi that referenced this issue May 28, 2024
@encukou encukou linked a pull request May 28, 2024 that will close this issue
@encukou
Copy link
Author

encukou commented May 28, 2024

The PR is at: #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants