Anki is a smart spaced repetition flashcard program
Find a file
Damien Elmes 04996c77f3
Migrate build system to uv (#4074)
* Migrate build system to uv

Closes #3787, and is a step towards #3081 and #4022

This change breaks our PyOxidizer bundling process. While we probably
could update it to work with the new venvs & lockfile, my intention
is to use this as a base to try out a uv-based packager/installer.

Some notes about the changes:

- Use uv for python download + venv installation
- Drop python/requirements* in favour of pyproject files / uv.lock
- Bumped to latest Python 3.9 version. The move to 3.13 should be
a fairly trivial change when we're ready.
- Dropped the old write_wheel.py in favour of uv/hatchling. This has
the unfortunate side-effect of dropping leading zeros in our wheels,
which we could try hack around in the future.
- Switch to Qt 6.7 for the dev repo, as it's the first PyQt version
with a Linux/ARM WebEngine wheel.
- Unified our macOS deployment target with minimum required for ARM.
- Dropped unused fluent python files
- Dropped unused python license generation
- Dropped helpers to run under Qt 5, as our wheels were already
requiring Qt 6 to install.

* Build action to create universal uv binary

* Drop some PyOxidizer-related files

* Use Windows ARM64 cargo/node binaries during build

We can't provide ARM64 wheels to users yet due to #4079, but we can
at least speed up the build.

The rustls -> native-tls change on Windows is because ring requires
clang to compile for ARM64, and I figured it's best to keep our Windows
deps consistent. We already built the wheels with native-tls.

* Make libankihelper a universal library

We were shipping a single arch library in a purelib, leading to
breakages when running on a different platform.

* Use Python wheel for mpv/lame on Windows/Mac

This is convenient, but suboptimal on a Mac at the moment. The first
run of mpv will take a number of seconds for security checks to run,
and our mpv code ends up timing out, repeating the process each time.
Our installer stub will need to invoke mpv once first to get it validated.

We could address this by distributing the audio with the installer/stub,
or perhaps by putting the binaries in a .pkg file that's notarized+stapled
and then included in the wheel.

* Add some helper scripts to build a fully-locked wheel

* Initial macOS launcher prototype

* Add a hidden env var to preload our libs and audio helpers on macOS

* qt/bundle -> qt/launcher

- remove more of the old bundling code
- handle app icon

* Fat binary, notarization & dmg

* Publish wheels on testpypi for testing

* Use our Python pin for the launcher too

* Python cleanups

* Extend launcher to other platforms + more

- Switch to Qt 6.8 for repo default, as 6.7 depends on an older
libwebp/tiff which is unavailable on newer installs
- Drop tools/mac-x86, as we no longer need to test against Qt 5
- Add flags to cross compile wheels on Mac and Linux
- Bump glibc target to 2_36, building on Debian Stable
- Increase mpv timeout on macOS to allow for initial gatekeeper checks
- Ship both arm64 and amd64 uv on Linux, with a bash stub to pick
the appropriate arch.

* Fix pylint on Linux

* Fix failure to run from /usr/local/bin

* Remove remaining pyoxidizer refs, and clean up duplicate release folder

* Rust dep updates

- Rust 1.87 for now (1.88 due out in around a week)
- Nom looks involved, so I left it for now
- prost-reflect depends on a new prost version that got yanked

* Python 3.13 + dep updates

Updated protoc binaries + add helper in order to try fix build breakage.
Ended up being due to an AI-generated update to pip-system-certs that
was not reviewed carefully enough:
https://gitlab.com/alelec/pip-system-certs/-/issues/36

The updated mypy/black needed some tweaks to our files.

* Windows compilation fixes

* Automatically run Anki after installing on Windows

* Touch pyproject.toml upon install, so we check for updates

* Update Python deps

- urllib3 for CVE
- pip-system-certs got fixed
- markdown/pytest also updated
2025-06-19 14:03:16 +07:00
.buildkite Auto-expand bundle progress in Buildkite on Linux 2025-01-26 19:37:34 +11:00
.cargo Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
.config Drop workspace-hack in favor of workspace deps 2023-06-23 17:41:31 +10:00
.cursor/rules Make URL schemes dialog more ergonomic (#4002) 2025-05-15 16:17:33 +10:00
.github/ISSUE_TEMPLATE Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.vscode.dist Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
build Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
cargo Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
docs Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
ftl Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
proto Feat/Health check (#4047) 2025-06-06 12:43:33 +07:00
pylib Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
python Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
qt Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
rslib Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
tools Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
ts Update the default value of FSRS-6 decay in forgetting curve (#4096) 2025-06-19 13:25:30 +07:00
.deny.toml Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
.dockerignore Add distroless Dockerfile and implement internal health check (#3366) 2024-08-29 17:05:33 +07:00
.dprint.json Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
.eslintrc.cjs Include error message text on page 2024-06-24 15:35:47 +07:00
.gitattributes try again to improve GitHub's language stats 2021-01-20 13:20:45 +10:00
.gitignore Experiment with Claude 2025-06-19 13:17:30 +07:00
.gitmodules Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
.isort.cfg Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
.mypy.ini Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
.prettierrc Switch back to Prettier for Svelte formatting 2025-01-13 15:53:55 +11:00
.pylintrc Add ability to restore a notetype to its original configuration (#2472) 2023-04-18 14:07:51 +10:00
.python-version Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
.ruff.toml Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
.rustfmt-empty.toml Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.rustfmt.toml Move ascii_percent_encoding into a separate repo 2023-04-12 08:45:23 +10:00
.version Bump version 2025-06-06 14:05:33 +07:00
.yarnrc.yml Yarn 4 (#3772) 2025-01-26 14:40:17 +11:00
Cargo.lock Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
Cargo.toml Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
check Add a shortcut to auto-format before running checks 2023-07-02 09:59:05 +10:00
CLAUDE.md Experiment with Claude 2025-06-19 13:17:30 +07:00
CONTRIBUTORS Delay retention workload info display after FSRS optimization alerts (#4066) 2025-06-11 13:01:47 +07:00
LICENSE Replace css_browser_selector with our own implementation (#2854) 2023-11-30 10:57:33 +10:00
ninja Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
package.json Bump vite from 5.4.18 to 5.4.19 (#4018) 2025-05-19 13:38:53 +10:00
pkgkey.asc add public key for release signing 2018-09-18 10:40:45 +10:00
pyproject.toml Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
README.md Updated README (#2718) 2023-10-11 14:11:07 +10:00
run Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
run.bat Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
rust-toolchain.toml Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
SECURITY.md add SECURITY.md 2021-09-22 22:55:19 +10:00
uv.lock Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
yarn Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
yarn.bat Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
yarn.lock Bump vite from 5.4.18 to 5.4.19 (#4018) 2025-05-19 13:38:53 +10:00

Anki

Build status

This repo contains the source code for the computer version of Anki.

About

Anki is a spaced repetition program. Please see the website to learn more.

Getting Started

Anki Betas

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see Anki betas

Developing

For more information on building and developing, please see Development.

Contributing

Want to contribute to Anki? Check out the Contribution Guidelines.

Anki Contributors

CONTRIBUTORS

License

Anki's license: LICENSE