arskom / spyne

A transport agnostic sync/async RPC library that focuses on exposing services with a well-defined API using popular protocols.
http://spyne.io
Other
1.13k stars 312 forks source link

Problem with the spyne.six.moves module, import error #708

Open MateusLinhares-Dev opened 3 months ago

MateusLinhares-Dev commented 3 months ago

================================

Describe the bug the issue seems related to the vendored six module and specifically spyne.util.six.moves no longer being available.

To Reproduce

Traduzir textos com a câmera I'm using spyne on python 3.12 with django and spyne 2.14 latest version..., but I have no success when using runserver, it gives me this error stated above import six.move

sidmitra commented 2 months ago

Yes i can confirm that this seems to be breaking with 3.12

File "/Users/myuser/Projects/foobar/app/urls.py", line 3, in <module>
    from spyne.protocol.soap import Soap11
  File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/foobar-csyzUOJz-py3.12/lib/python3.12/site-packages/spyne/__init__.py", line 39, in <module>
    from spyne.evmgr import EventManager
  File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/foobar-csyzUOJz-py3.12/lib/python3.12/site-packages/spyne/evmgr.py", line 21, in <module>
    from spyne.util.oset import oset
  File "/Users/myuser/Library/Caches/pypoetry/virtualenvs/foobar-csyzUOJz-py3.12/lib/python3.12/site-packages/spyne/util/oset.py", line 3, in <module>
    from spyne.util.six.moves.collections_abc import MutableSet
ModuleNotFoundError: No module named 'spyne.util.six.moves'

Taking a look further to see what PR changed the vendor lib six and i can create a fork with the changes.

incx444 commented 1 month ago

Spyne 2.14 launched in Feb 2022, before even Python 3.11 was released.

You can try to replace the vendored six 1.14 in spyne 2.14 with 1.16 or switch to current code state in the git repo (the six upgrade has already been done there 7 months ago, see 50f2a2ff2a153329ad4feec5ea93d6d4e7e29054).

From very short experience trying to get some older code running on python 3.12 tonight, option 1 does need a bit more massaging of spyne code (the vendored version of six has some customizations such as get_function_name which are not in standard six 1.16) but can reach a working state, option 2 I haven't tried yet.