aqt.package#

Helpers for the packaged version of Anki.

Functions#

first_run_setup(→ None)

Code run the first time after install/upgrade.

uv_binary(→ str | None)

Return the path to the uv binary.

launcher_root(→ str | None)

Return the path to the launcher root directory (AnkiProgramFiles).

venv_binary(→ str | None)

Return the path to a binary in the launcher's venv.

add_python_requirements(→ tuple[bool, str])

Add Python requirements to the launcher venv using uv add.

launcher_executable(→ str | None)

Return the path to the Anki launcher executable.

trigger_launcher_run(→ None)

Create a trigger file to request launcher UI on next run.

update_and_restart(→ None)

Update and restart Anki using the launcher.

Module Contents#

aqt.package.first_run_setup() None#

Code run the first time after install/upgrade.

Currently, we just import our main libraries and invoke mpv/lame on macOS, which is slow on the first run, and doing it this way shows progress being made.

aqt.package.uv_binary() str | None#

Return the path to the uv binary.

aqt.package.launcher_root() str | None#

Return the path to the launcher root directory (AnkiProgramFiles).

aqt.package.venv_binary(cmd: str) str | None#

Return the path to a binary in the launcher’s venv.

aqt.package.add_python_requirements(reqs: list[str]) tuple[bool, str]#

Add Python requirements to the launcher venv using uv add.

Returns (success, output)

aqt.package.launcher_executable() str | None#

Return the path to the Anki launcher executable.

aqt.package.trigger_launcher_run() None#

Create a trigger file to request launcher UI on next run.

aqt.package.update_and_restart() None#

Update and restart Anki using the launcher.