Tecnativa / docker-whitelist

A socat service to whitelist network connections
Apache License 2.0
8 stars 8 forks source link

[FIX] proxy.py: fix proxy for python 3.11 #11

Closed ap-wtioit closed 10 months ago

ap-wtioit commented 2 years ago

on our CI we got the following error during tests:

AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?
Traceback (most recent call last):
  File "/usr/local/bin/proxy", line 25, in <module>
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^

As stated in the python documentation, https://docs.python.org/3.10/library/asyncio-task.html#asyncio.coroutine:

This decorator should not be used for async def coroutines.

and

Deprecated since version 3.8, will be removed in version 3.11: Use async def instead.

Info @wt-io-it

ap-wtioit commented 2 years ago

also updated black in pre-commit to 22.3.0 to prevent:

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repoil7v2omk/py_env-python3/bin/black", line 8, in <module>
    sys.exit(patched_main())
  File "/home/runner/.cache/pre-commit/repoil7v2omk/py_env-python3/lib/python3.10/site-packages/black/__init__.py", line 6606, in patched_main
    patch_click()
  File "/home/runner/.cache/pre-commit/repoil7v2omk/py_env-python3/lib/python3.10/site-packages/black/__init__.py", line 6595, in patch_click
    from click import _unicodefun  # type: ignore
ImportError: cannot import name '_unicodefun' from 'click' (/home/runner/.cache/pre-commit/repoil7v2omk/py_env-python3/lib/python3.10/site-packages/click/__init__.py)

see https://stackoverflow.com/a/71674345/925125

pedrobaeza commented 10 months ago

Sorry, I didn't see it and fix it in #18