Skip to content

Incompatibility with asgiref, pypy and coverage #393

Open
@LilyAcorn

Description

@LilyAcorn

I'm not sure which project is at fault, but asgiref 3.7.0 and 3.7.1 both fail. 3.6.0 does not.

If I put this in a test.py:

from asgiref.sync import iscoroutinefunction, markcoroutinefunction, sync_to_async

And run:

$ coverage run test.py 
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from asgiref.sync import iscoroutinefunction, markcoroutinefunction, sync_to_async
  File "/home/ian/work/asgiref/asgiref/sync.py", line 130, in <module>
    class AsyncToSync(Generic[_P, _R]):
  File "/home/ian/.pyenv/versions/pypy3.8-7.3.11/lib/pypy3.8/typing.py", line 261, in inner
    return func(*args, **kwds)
  File "/home/ian/.pyenv/versions/pypy3.8-7.3.11/lib/pypy3.8/typing.py", line 890, in __class_getitem__
    raise TypeError(
TypeError: Parameters to Generic[...] must all be type variables

These are my installed packages:

$ pip freeze
asgiref==3.7.1
cffi==1.15.1
coverage==7.2.6
greenlet==0.4.13
hpy==0.0.4.dev179+g9b5d200
readline==6.2.4.1
typing_extensions==4.6.1

Bisected to 72f45c5 locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions