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

PyPI released version is outdated #6

Open
caryoscelus opened this issue Dec 7, 2023 · 2 comments
Open

PyPI released version is outdated #6

caryoscelus opened this issue Dec 7, 2023 · 2 comments

Comments

@caryoscelus
Copy link

bootstrap
venv/lib/python3.11/site-packages/aiobtdht/dht.py:245: RuntimeWarning: coroutine 'DHT.remote_find_node' was never awaited
  await asyncio.gather(
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Task exception was never retrieved
future: <Task finished name='Task-4' coro=<run_every() done, defined at venv/lib/python3.11/site-packages/aiobtdht/utils.py:59> exception=TypeError("gather() got an unexpected keyword argument 'loop'")>
Traceback (most recent call last):
  File "venv/lib/python3.11/site-packages/aiobtdht/utils.py", line 64, in run_every
    await r
  File "venv/lib/python3.11/site-packages/aiobtdht/dht.py", line 214, in _refresh_nodes
    await asyncio.gather(
          ^^^^^^^^^^^^^^^
TypeError: gather() got an unexpected keyword argument 'loop'
Traceback (most recent call last):
  File "sample.py", line 41, in <module>
    loop.run_until_complete(main(loop))
  File "/run/current-system/sw/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "sample.py", line 19, in main
    await dht.bootstrap(initial_nodes)
  File "venv/lib/python3.11/site-packages/aiobtdht/dht.py", line 290, in bootstrap
    responses = await self._group_invoke(lambda peer: self.remote_find_node(peer, self.id), peers)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "venv/lib/python3.11/site-packages/aiobtdht/dht.py", line 245, in _group_invoke
    await asyncio.gather(
          ^^^^^^^^^^^^^^^
TypeError: gather() got an unexpected keyword argument 'loop'

python 3.11.6, installed via pip in venv

@zrthstr
Copy link

zrthstr commented Dec 10, 2023

Hi, the reason why your code does not work is most likely that you are using the pip release which is a few years old and does not have the newest bug fixes from the repo. (this is also true for aiokrpc, one of the dependencies of aiobtdht)

A simple way to mitigate this issue is to tell pip to install the newest version from GitHub and not the official pip package.

You can do this with:

pip install git+https://github.com/bashkirtsevich-llc/aiobtdht
pip install git+https://github.com/bashkirtsevich-llc/aiokrpc

Your requirements.txt should look something like this:

aio-btdht @ git+https://github.com/bashkirtsevich-llc/aiobtdht@f99d881e9b992da13519721e251912c32a566cd7
aio-krpc-server @ git+https://github.com/bashkirtsevich-llc/aiokrpc@fe0b18a98d4dc19034f8152afbae78fb600830e2
aio-udp-server==0.0.6
Cerberus==1.3.1
[.....]

In the meanwhile we could kindly ask @mweinelt or @bashkirtsevich to trigger a new release on pypy for this package as well as for aiokrpc, would this be possible?
Please let me know if i can help somehow with this process!

@caryoscelus
Copy link
Author

@zrthstr thanks, that makes it work indeed!

@caryoscelus caryoscelus changed the title example doesn't work PyPI released version is outdated Dec 10, 2023
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

2 participants