allista / WakatimeBlender

This is a plugin for the Blender that sends statistics to the Wakatime time tracking service.
MIT License
28 stars 16 forks source link

3.1 Compatibility #20

Open williamchange opened 2 years ago

williamchange commented 2 years ago

in 3.1 python 3.10 was introduced so this seem to have broken the add-on

[Wakatime] [INFO] Initializing Wakatime plugin v2.0.1
[Wakatime] [INFO] Found Wakatime client
[Wakatime] [INFO] project-name in Wakatime: untitled
[Wakatime] [ERROR] Error
[Wakatime] [ERROR] wakatime-core exited with status: 1
[Wakatime] [ERROR] wakatime-core output: Traceback (most recent call last):
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/cli.py", line 24, in <module>
    import wakatime
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/__init__.py", line 17, in <module>
    from .main import execute
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/main.py", line 32, in <module>
    from .api import send_heartbeats, get_time_today
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/api.py", line 22, in <module>
    from .session_cache import SessionCache
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/session_cache.py", line 26, in <module>
    from .packages import requests
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/connectionpool.py", line 29, in <module>
    from .connection import (
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/connection.py", line 39, in <module>
    from .util.ssl_ import (
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/util/__init__.py", line 3, in <module>
    from .connection import is_connection_dropped
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/util/connection.py", line 3, in <module>
    from .wait import wait_for_read
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/util/wait.py", line 1, in <module>
    from .selectors import (
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/util/selectors.py", line 14, in <module>
    from collections import namedtuple, Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/Applications/Blender/3.1.1/Blender.app/Contents/Resources/3.1/python/lib/python3.10/collections/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/cli.py", line 31, in <module>
    import wakatime
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/__init__.py", line 17, in <module>
    from .main import execute
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/main.py", line 32, in <module>
    from .api import send_heartbeats, get_time_today
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/api.py", line 22, in <module>
    from .session_cache import SessionCache
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/session_cache.py", line 26, in <module>
    from .packages import requests
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/connectionpool.py", line 29, in <module>
    from .connection import (
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/connection.py", line 39, in <module>
    from .util.ssl_ import (
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/util/__init__.py", line 3, in <module>
    from .connection import is_connection_dropped
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/util/connection.py", line 3, in <module>
    from .wait import wait_for_read
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/util/wait.py", line 1, in <module>
    from .selectors import (
  File "/Users/lmw/.wakatime/wakatime-runtime/legacy-python-cli-master/wakatime/packages/urllib3/util/selectors.py", line 14, in <module>
    from collections import namedtuple, Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/Applications/Blender/3.1.1/Blender.app/Contents/Resources/3.1/python/lib/python3.10/collections/__init__.py)
Rainbrony commented 2 years ago

Hi, I'm encountering the same problem, I found something in https://github.com/colour-science/colour/issues/511 and did the change, now there's no error, but also not working, I'm looking into it now

Rainbrony commented 2 years ago

Anyone encountering this issue can take a look into my fork's release https://github.com/Rainbrony/WakatimeBlender/releases/tag/v2.0.1-b3.1.0, It's working good on my machine.

williamchange commented 2 years ago

Anyone encountering this issue can take a look into my fork's release https://github.com/Rainbrony/WakatimeBlender/releases/tag/v2.0.1-b3.1.0, It's working good on my machine.

Doesn't seem to work for me on a mac os machine. Can't get the add-on to enable image

allista commented 2 years ago

Ok, this is sad, but the only way to solve this is to reimplement the wakatime runtime wrapper so that it would download the go runtime compiled for user's system. Unfortunately, the process of deciding which version to download requires a lot of black magic:

https://github.com/wakatime/sublime-wakatime/blob/e5331d3086c6de2014b688553529aa1cf85d22b3/WakaTime.py#L619