asterisk / ari-py

Library for accessing the Asterisk REST Interface
Other
151 stars 106 forks source link

This does not works with python3 latest version #38

Open voicecomms opened 10 months ago

voicecomms commented 10 months ago

Hello,

is there any update on getting this working on python3 latest version ?

Regards CJ

zferentz commented 5 months ago

@voicecomms any idea what's not working ? I'm using this module (With some patches on top of it) with Python 3.10 . I wonder which Python version you're using and what doestn't work ...

samagra44 commented 5 months ago

@zferentz I am getting ModuleNotFoundError: No module named 'client'

zferentz commented 5 months ago

That's weird. this is how I'm building it (Python3.10), hope it helps :

rm -rf ari-py
git clone https://github.com/asterisk/ari-py.git
pushd ari-py

# Apply patch PR#16 - python3 support
wget https://patch-diff.githubusercontent.com/raw/asterisk/ari-py/pull/16.patch -O pr16.patch
patch -p1 -i pr16.patch

# Apply patch PR#26 - avoid circular reference that cause socket leak
wget https://patch-diff.githubusercontent.com/raw/asterisk/ari-py/pull/26.patch -O pr26.patch
patch -p1 -i pr26.patch

And then just use the standard setup.py to build.

codeasashu commented 1 month ago

@zferentz You know this library is clearly incompatible with python3 when you have to apply tons of patches to get it working. This means:

  1. This library is dead
  2. It clearly doesn't support any modern python3 features (such as async).

There exists a async version https://github.com/M-o-a-T/asyncari but it uses stone-age packages that make it as useless as this one.

zferentz commented 1 month ago

@codeasashu of course i know :) . i wish it was easy for me to switch to asyncio. one day...but until that day i'm stuck with a 10-years library that i cannot update/replace.

Having said the above - i'm happy to say that we used this library with Python2.6, Python3.6, Python3.8 and recently upgraded to Python3.10 and (except those patches) - all worked perfectly .