glutanimate / review-heatmap

Anki add-on to help you keep track of your review activity
https://ankiweb.net/shared/info/1771074083
Other
1.2k stars 88 forks source link

Add-on should import json directly, not from anki.utils #144

Closed IllDepence closed 2 years ago

IllDepence commented 2 years ago

Problem description

When I run Anki in a dedicated Python virtual environment as follows

$ python3.9 -m venv anki_venv
$ source anki_venv/bin/activate
$ pip install --upgrade pip
$ pip install aqt
$ anki

Anki complains that json is imported from anki.utils and not directly:

[...]
  File "/home/[...]/.local/share/Anki2/addons21/review_heatmap/heatmap.py", line 37, in <module>
    from anki.utils import json
  File "/home/[...]/anki_venv/lib/python3.9/site-packages/anki/utils.py", line 41, in __getattr__
    traceback.print_stack(file=sys.stdout)
add-on should import json directly, not from anki.utils

This is the case in the following two places: https://github.com/glutanimate/review-heatmap/blob/master/src/review_heatmap/heatmap.py#L36 https://github.com/glutanimate/review-heatmap/blob/master/src/review_heatmap/libaddon/anki/configmanager.py#L42

Checklist

Please replace the space inside the brackets with an x if the following items apply:

Information about your Anki set-up

see above

Error message (if any)

see abve

glutanimate commented 2 years ago

Thanks for the report! This is now fixed in v1.0.0.