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

Importing pook fails on Python 3.11 #84

Closed
martydill opened this issue Dec 16, 2022 · 7 comments
Closed

Importing pook fails on Python 3.11 #84

martydill opened this issue Dec 16, 2022 · 7 comments

Comments

@martydill
Copy link

Trying to use Pook on Python 3.11 fails:

/usr/local/lib/python3.11/site-packages/pook/activate_async.py:2: in <module>
    from asyncio import iscoroutinefunction, coroutine
E   ImportError: cannot import name 'coroutine' from 'asyncio' (/usr/local/lib/python3.11/asyncio/__init__.py)

It was removed in 3.11 python/cpython#26369

@gpxlnx
Copy link

gpxlnx commented Dec 30, 2022

I'm receice this same error when import:

E AttributeError: module 'asyncio' has no attribute 'coroutine'
_ ERROR collecting .pybuild/cpython3_3.11_pook/build/tests/unit/mock_engine_test.py _
tests/unit/mock_engine_test.py:4: in
from pook import MockEngine, Engine
pook/init.py:1: in
from .api import * # noqa
pook/api.py:6: in
from .engine import Engine
pook/engine.py:5: in
from .mock_engine import MockEngine
pook/mock_engine.py:1: in
from .interceptors import interceptors
pook/interceptors/init.py:25: in
from .aiohttp import AIOHTTPInterceptor
pook/interceptors/aiohttp.py:42: in
class SimpleContent(EmptyStreamReader):
pook/interceptors/aiohttp.py:47: in SimpleContent
@asyncio.coroutine
E AttributeError: module 'asyncio' has no attribute 'coroutine'
_ ERROR collecting .pybuild/cpython3_3.11_pook/build/tests/unit/interceptors/module_test.py _
tests/unit/interceptors/module_test.py:1: in

@KyleJamesWalker
Copy link
Contributor

KyleJamesWalker commented Jan 4, 2023

Fixed in #83, but it still hasn't' been released.

Note while waiting for v1.1.0 you can install the sha to test it:

pip install -U https://github.com/h2non/pook/archive/0d9a6f7ae0e5c33c845069f0bde6cb65805be906.zip

@h2non
Copy link
Owner

h2non commented Jan 10, 2023

Version v1.1.0 is now available on PyPI:
pip install --upgrade pook

@h2non h2non closed this as completed Jan 10, 2023
@gpxlnx
Copy link

gpxlnx commented Jan 10, 2023

Hi,

I am your package maintainer on Debian and derivatives and would like to know if you have any plans to release the latest release on github?

Thanks for your job

@h2non
Copy link
Owner

h2non commented Jan 10, 2023

It is already released and tagged as v1.1.0

@MikhailGurin
Copy link

Hi,
the problem is still there on v1.1.0
/usr/local/lib/python3.11/site-packages/pook/activate_async.py:2: in
from asyncio import iscoroutinefunction, coroutine
ImportError: cannot import name 'coroutine' from 'asyncio' (/usr/local/lib/python3.11/asyncio/init.py)

activate_async.py was not fixed in last release

danigm added a commit to danigm/pook that referenced this issue Jan 12, 2023
The asyncio.coroutine doesn't exist in Python 3.11 and future versions:
python/cpython#87382

See h2non#84
h2non pushed a commit that referenced this issue Jan 12, 2023
* Remove asyncio.coroutine usage

The asyncio.coroutine doesn't exist in Python 3.11 and future versions:
python/cpython#87382

See #84

* Add python 3.11 to tests

* lint: fix lint issue mock_test.py
@h2non
Copy link
Owner

h2non commented Jan 12, 2023

FYI - v1.1.1 is out on PyPI: pip install --upgrade pook

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

No branches or pull requests

5 participants