Upgrading to Python 3.10

As @dae noted in ankitects/anki#3081 and discussed here Anki is stuck on 3.9.18.

However, PyOxidizer supports up to 3.10. Can we at least upgrade to 3.10? The fork of Pyoxidizer that Anki references is 111 commits behind indygreg/PyOxidizer:main.

I’m asking because there are some libraries that require at least 3.10 that I’d like to vendor with an add-on. :pleading_face:

5 Likes

Is the “correct” way to build Anki locally with a specific Python version to specify the PYTHON_BINARY env var that is used here? E.g., PYTHON_BINARY=/opt/homebrew/Caskroom/miniconda/base/envs/anki/bin/python ./run. I was surprised to find that ./run doesn’t seem to care about the python version in PATH.

Though it’s just an idea, in case of add-ons development and the module is not compatible with the Python version of Anki, it seems to me that it would be better to develop another small app to communicate like Anki Connect (I created a small app with PyInstaller to restart Anki with my add-on AnkiRestart, about 6MB each). The disadvantage of this approach is that if the app is not paid code-signed it will be rejected by VirusBuster (especially Mac), but Ankihub has professional developers so maybe this is not a problem.

The downside to that is that the app wouldn’t have access to everything a normal add-on does (probably doesn’t matter for lots of use cases, but still). Also, Python 3.9 is reaching end of life this year, so I think t needs to be upgraded anyway.

4 Likes

To clarify my comment on Upgrade python by andrewsanchez · Pull Request #4023 · ankitects/anki · GitHub, we should be able to upgrade to 3.10 by using an older python-build-standalone release, but probably won’t be able to use the newer astral ones.

1 Like