anki鸿蒙化
| Files | Last commit | Last update |
|---|---|---|
Statically link MSVC runtime, removing the need to install the redistributable (#4166) * Statically link MSVC runtime, removing the need to install the redistributable. * CONTRIBUTORS I've already contributed and added my email, but the last commit got mangled. | 1 year ago | |
Drop workspace-hack in favor of workspace deps Workspace deps were introduced in Rust 1.64. They don't cover all the cases that Hakari did unfortunately, but they are simpler to maintain, and they avoid a couple of issues that Hakari had: - It sometimes made updating dependencies harder due to the locked versions, so you had to disable Hakari, do the updates, and then re-generate ( e.g. 943dddf28f9a5bfbf49fd9b8501feb3d15fd2b81) - The current Hakari config was breaking AnkiDroid's build, as it was stopping a cross-compile from functioning correctly. | 3 years ago | |
Make URL schemes dialog more ergonomic (#4002) (originally merged into a PR branch) * Make URL schemes dialog more ergonomic * add name to contributors list * Title Case * Tweak build instructions so Cursor picks them up * Use a warning icon for the URL scheme pop-up * Default to cancelling | 1 year ago | |
chore: Integrate Complexipy for complexity analysis (#4942) ## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The check:complexity Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - just complexipy-diff is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run ./ninja check:complexity locally and confirm it passes. - Test diff mode: just complexipy-diff main. | 5 months ago | |
Update PyCharm docs (#4389) * Add .idea.dist * Update PyCharm docs | 1 year ago | |
Update VS Code config (#4397) | 1 year ago | |
chore: Integrate Complexipy for complexity analysis (#4942) ## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The check:complexity Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - just complexipy-diff is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run ./ninja check:complexity locally and confirm it passes. - Test diff mode: just complexipy-diff main. | 5 months ago | |
Release infrastructure improvements (#4802) - Run CI automatically on release/** branches - Update just recipes: require --ref, add --version to prepare, add testpypi/pypi recipes - Document release branch workflow and update releasing docs - Add sphinxcontrib-mermaid for Sphinx doc rendering | 6 months ago | |
docs: expand contributing guide with PR process and test requirements (#4946) ## Linked issue Closes #4945 ## Summary / motivation Two small clarifications to the contributing guide: - Added a **Pull Request Description** section pointing contributors to the PR template ( .github/pull_request_template.md), so they know upfront what fields are required before opening a PR. - Strengthened the test coverage requirement from "please consider" to a clear rule, with explicit exceptions (version bumps, docs, translations, dependency updates, chore). | 5 months ago | |
Briefcase Installer (#4629) migrates Anki Desktop packaging from the legacy NSIS/uv-based installer to [BeeWare Briefcase](https://briefcase.readthedocs.io/). This branch integrates work from many related issues and PRs to deliver cross-platform native installers (MSI on Windows, .app on macOS, PyInstaller on Linux) with code signing, notarization, and file association support. ## Integrated PRs - #4585 — Set up Briefcase - #4596 — Add Briefcase icons - #4598 — Handle Briefcase file associations - #4601 — Add Briefcase app permissions - #4609 — Customize Briefcase's MSI installer - #4616 — Set up Briefcase code signing and notarization - #4618 — Fix Briefcase packaging for x86 Macs - #4623 — Customize Briefcase's Linux template - #4627 — List required Debian packages for Briefcase installer - #4630 — Update Briefcase's Windows template - #4631 — Rewrite Linux install/uninstall scripts for PyInstaller - #4638 — Use PyInstaller on Linux - #4645 — Update installer docs - #4654 — Disable Briefcase's universal builds for macOS - #4672 — Deal with existing NSIS installations in MSI installer - #4676 — Remove duplicate Briefcase icons - #4677 — Tweak Linux scripts for new installer - #4709 — Add anki-console.bat to Briefcase's Windows package ## Related Issues - #4557 — Evaluate BeeWare Briefcase for Anki packaging and distribution - #4678 — Support native Windows ARM64 builds for Briefcase - #4688 — Linux installer: migrate to PyInstaller and rewrite install scripts - #4689 — Investigate startup performance with Briefcase - #4690 — Specify required Linux system packages for Briefcase - #4691 — Investigate Windows ARM64 support with Briefcase - #4692 — Test on Linux ARM with Briefcase - #4693 — Separate ARM and Intel macOS releases - #4694 — Update developer documentation for Briefcase installer - #4695 — Support upgrade/downgrade with the Briefcase installer - #4696 — Update user documentation for new installer - #4702 — Update Briefcase's Windows template with upstream security fix and OS version check - #4703 — Follow-up tweaks to Linux install/uninstall scripts ## Related PRs - #4619 — Enable Windows ARM64 support - #4632 — Release action --------- Co-authored-by: Abdo <abdo@abdnh.net> Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com> Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com> | 6 months ago | |
鸿蒙化 | 5 months ago | |
Briefcase Installer (#4629) migrates Anki Desktop packaging from the legacy NSIS/uv-based installer to [BeeWare Briefcase](https://briefcase.readthedocs.io/). This branch integrates work from many related issues and PRs to deliver cross-platform native installers (MSI on Windows, .app on macOS, PyInstaller on Linux) with code signing, notarization, and file association support. ## Integrated PRs - #4585 — Set up Briefcase - #4596 — Add Briefcase icons - #4598 — Handle Briefcase file associations - #4601 — Add Briefcase app permissions - #4609 — Customize Briefcase's MSI installer - #4616 — Set up Briefcase code signing and notarization - #4618 — Fix Briefcase packaging for x86 Macs - #4623 — Customize Briefcase's Linux template - #4627 — List required Debian packages for Briefcase installer - #4630 — Update Briefcase's Windows template - #4631 — Rewrite Linux install/uninstall scripts for PyInstaller - #4638 — Use PyInstaller on Linux - #4645 — Update installer docs - #4654 — Disable Briefcase's universal builds for macOS - #4672 — Deal with existing NSIS installations in MSI installer - #4676 — Remove duplicate Briefcase icons - #4677 — Tweak Linux scripts for new installer - #4709 — Add anki-console.bat to Briefcase's Windows package ## Related Issues - #4557 — Evaluate BeeWare Briefcase for Anki packaging and distribution - #4678 — Support native Windows ARM64 builds for Briefcase - #4688 — Linux installer: migrate to PyInstaller and rewrite install scripts - #4689 — Investigate startup performance with Briefcase - #4690 — Specify required Linux system packages for Briefcase - #4691 — Investigate Windows ARM64 support with Briefcase - #4692 — Test on Linux ARM with Briefcase - #4693 — Separate ARM and Intel macOS releases - #4694 — Update developer documentation for Briefcase installer - #4695 — Support upgrade/downgrade with the Briefcase installer - #4696 — Update user documentation for new installer - #4702 — Update Briefcase's Windows template with upstream security fix and OS version check - #4703 — Follow-up tweaks to Linux install/uninstall scripts ## Related PRs - #4619 — Enable Windows ARM64 support - #4632 — Release action --------- Co-authored-by: Abdo <abdo@abdnh.net> Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com> Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com> | 6 months ago | |
chore: Integrate Complexipy for complexity analysis (#4942) ## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The check:complexity Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - just complexipy-diff is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run ./ninja check:complexity locally and confirm it passes. - Test diff mode: just complexipy-diff main. | 5 months ago | |
Build and publish dev docs (#4579) | 7 months ago | |
| 5 months ago | ||
fix: Parameterize inputs of prop:cd* queries (#4905) It was possible to construct invalid SQLite queries for browser searches in some cases, for example by searching for prop:cds:foo=';. | 5 months ago | |
| 5 months ago | ||
fix(sass): replace global map-get/map-merge with sass:map namespace in _functions.scss (#4955) ## Summary Closes #4954. _functions.scss already had @use "sass:map" at the top but was still calling the deprecated global functions map-get and map-merge. Replaced all occurrences with their namespaced equivalents map.get and map.merge. This eliminates the [global-builtin] deprecation warnings visible in every Check (Linux) CI run, which will become hard errors in Dart Sass 3.0. ## Test plan - [x] just lint passes - [x] just test-ts passes with no deprecation warnings ## Before / after behavior (optional) ### at main branch <img width="1325" height="906" alt="Image" src="https://github.com/user-attachments/assets/6a35ac2d-418a-4ded-baf6-f959b06b8d48" /> ### at this branch <img width="1156" height="921" alt="image" src="https://github.com/user-attachments/assets/276a15ce-b319-4ee5-9ae2-122cd4d4d45e" /> | 5 months ago | |
chore: Integrate Complexipy for complexity analysis (#4942) ## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The check:complexity Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - just complexipy-diff is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run ./ninja check:complexity locally and confirm it passes. - Test diff mode: just complexipy-diff main. | 5 months ago | |
Update to Rust 1.92 (#4461) * Update to Rust 1.90 * Fix clippy errors * Update to 1.92 * Update cargo-deny again Deno crate was using a CVSS version 4.0, which wasn't supported --------- Co-authored-by: Damien Elmes <gpg@ankiweb.net> | 9 months ago | |
Add distroless Dockerfile and implement internal health check (#3366) - rslib(http_server): add is_running() method - rslib(sync): introduce --healthcheck argument for health probe in distroless - doc(syncserver): add table comparing Dockerfile and Dockerfile.distroless - Expand cross-platform support with distroless - add Dockerfile.distroless - Dockerfile: bump rust 1.79 to 1.80.1 - Dockerfile: bump alpine 3.20 to 3.20.2 Note: Implemented an internal health check because distroless images do not include curl, which is used to reduce image size and attack surface. For more details, see https://blog.sixeyed.com/docker-healthchecks-why-not-to-use-curl-or-iwr/ https://github.com/GoogleContainerTools/distroless fix: failed: check:format:rust typo remove extra space fix failed:check:format:rust update doc fetch host and port using envy fix: failed: check:format:rust Update doc + add dockerignore - dockerignore: This helps avoid sending unwanted files and directories to the builder - add new line - I am still experimenting cross platform compilation, I am getting 4.337 From https://github.com/ankitects/rust-url 4.337 * [new ref] bb930b8d089f4d30d7d19c12e54e66191de47b88 -> refs/commit/bb930b8d089f4d30d7d19c12e54e66191de47b88 4.397 error: failed to get percent-encoding-iri as a dependency of package anki v0.0.0 (/app/rslib) still checking what could be the issue fix: failed: check:format:dprint | 2 years ago | |
Briefcase Installer (#4629) migrates Anki Desktop packaging from the legacy NSIS/uv-based installer to [BeeWare Briefcase](https://briefcase.readthedocs.io/). This branch integrates work from many related issues and PRs to deliver cross-platform native installers (MSI on Windows, .app on macOS, PyInstaller on Linux) with code signing, notarization, and file association support. ## Integrated PRs - #4585 — Set up Briefcase - #4596 — Add Briefcase icons - #4598 — Handle Briefcase file associations - #4601 — Add Briefcase app permissions - #4609 — Customize Briefcase's MSI installer - #4616 — Set up Briefcase code signing and notarization - #4618 — Fix Briefcase packaging for x86 Macs - #4623 — Customize Briefcase's Linux template - #4627 — List required Debian packages for Briefcase installer - #4630 — Update Briefcase's Windows template - #4631 — Rewrite Linux install/uninstall scripts for PyInstaller - #4638 — Use PyInstaller on Linux - #4645 — Update installer docs - #4654 — Disable Briefcase's universal builds for macOS - #4672 — Deal with existing NSIS installations in MSI installer - #4676 — Remove duplicate Briefcase icons - #4677 — Tweak Linux scripts for new installer - #4709 — Add anki-console.bat to Briefcase's Windows package ## Related Issues - #4557 — Evaluate BeeWare Briefcase for Anki packaging and distribution - #4678 — Support native Windows ARM64 builds for Briefcase - #4688 — Linux installer: migrate to PyInstaller and rewrite install scripts - #4689 — Investigate startup performance with Briefcase - #4690 — Specify required Linux system packages for Briefcase - #4691 — Investigate Windows ARM64 support with Briefcase - #4692 — Test on Linux ARM with Briefcase - #4693 — Separate ARM and Intel macOS releases - #4694 — Update developer documentation for Briefcase installer - #4695 — Support upgrade/downgrade with the Briefcase installer - #4696 — Update user documentation for new installer - #4702 — Update Briefcase's Windows template with upstream security fix and OS version check - #4703 — Follow-up tweaks to Linux install/uninstall scripts ## Related PRs - #4619 — Enable Windows ARM64 support - #4632 — Release action --------- Co-authored-by: Abdo <abdo@abdnh.net> Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com> Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com> | 6 months ago | |
Include error message text on page Also remove the '500' h1 from the error Closes #3248 | 2 years ago | |
try again to improve GitHub's language stats - It seems this only alters the % graph on the front page, and does not control the options available when drilling down in a search. - The cargo/remote/*.bzl files were not being ignored; try "vendor" them instead. | 5 years ago | |
chore: Integrate Complexipy for complexity analysis (#4942) ## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The check:complexity Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - just complexipy-diff is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run ./ninja check:complexity locally and confirm it passes. - Test diff mode: just complexipy-diff main. | 5 months ago | |
Briefcase Installer (#4629) migrates Anki Desktop packaging from the legacy NSIS/uv-based installer to [BeeWare Briefcase](https://briefcase.readthedocs.io/). This branch integrates work from many related issues and PRs to deliver cross-platform native installers (MSI on Windows, .app on macOS, PyInstaller on Linux) with code signing, notarization, and file association support. ## Integrated PRs - #4585 — Set up Briefcase - #4596 — Add Briefcase icons - #4598 — Handle Briefcase file associations - #4601 — Add Briefcase app permissions - #4609 — Customize Briefcase's MSI installer - #4616 — Set up Briefcase code signing and notarization - #4618 — Fix Briefcase packaging for x86 Macs - #4623 — Customize Briefcase's Linux template - #4627 — List required Debian packages for Briefcase installer - #4630 — Update Briefcase's Windows template - #4631 — Rewrite Linux install/uninstall scripts for PyInstaller - #4638 — Use PyInstaller on Linux - #4645 — Update installer docs - #4654 — Disable Briefcase's universal builds for macOS - #4672 — Deal with existing NSIS installations in MSI installer - #4676 — Remove duplicate Briefcase icons - #4677 — Tweak Linux scripts for new installer - #4709 — Add anki-console.bat to Briefcase's Windows package ## Related Issues - #4557 — Evaluate BeeWare Briefcase for Anki packaging and distribution - #4678 — Support native Windows ARM64 builds for Briefcase - #4688 — Linux installer: migrate to PyInstaller and rewrite install scripts - #4689 — Investigate startup performance with Briefcase - #4690 — Specify required Linux system packages for Briefcase - #4691 — Investigate Windows ARM64 support with Briefcase - #4692 — Test on Linux ARM with Briefcase - #4693 — Separate ARM and Intel macOS releases - #4694 — Update developer documentation for Briefcase installer - #4695 — Support upgrade/downgrade with the Briefcase installer - #4696 — Update user documentation for new installer - #4702 — Update Briefcase's Windows template with upstream security fix and OS version check - #4703 — Follow-up tweaks to Linux install/uninstall scripts ## Related PRs - #4619 — Enable Windows ARM64 support - #4632 — Release action --------- Co-authored-by: Abdo <abdo@abdnh.net> Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com> Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com> | 6 months ago | |
Briefcase Installer (#4629) migrates Anki Desktop packaging from the legacy NSIS/uv-based installer to [BeeWare Briefcase](https://briefcase.readthedocs.io/). This branch integrates work from many related issues and PRs to deliver cross-platform native installers (MSI on Windows, .app on macOS, PyInstaller on Linux) with code signing, notarization, and file association support. ## Integrated PRs - #4585 — Set up Briefcase - #4596 — Add Briefcase icons - #4598 — Handle Briefcase file associations - #4601 — Add Briefcase app permissions - #4609 — Customize Briefcase's MSI installer - #4616 — Set up Briefcase code signing and notarization - #4618 — Fix Briefcase packaging for x86 Macs - #4623 — Customize Briefcase's Linux template - #4627 — List required Debian packages for Briefcase installer - #4630 — Update Briefcase's Windows template - #4631 — Rewrite Linux install/uninstall scripts for PyInstaller - #4638 — Use PyInstaller on Linux - #4645 — Update installer docs - #4654 — Disable Briefcase's universal builds for macOS - #4672 — Deal with existing NSIS installations in MSI installer - #4676 — Remove duplicate Briefcase icons - #4677 — Tweak Linux scripts for new installer - #4709 — Add anki-console.bat to Briefcase's Windows package ## Related Issues - #4557 — Evaluate BeeWare Briefcase for Anki packaging and distribution - #4678 — Support native Windows ARM64 builds for Briefcase - #4688 — Linux installer: migrate to PyInstaller and rewrite install scripts - #4689 — Investigate startup performance with Briefcase - #4690 — Specify required Linux system packages for Briefcase - #4691 — Investigate Windows ARM64 support with Briefcase - #4692 — Test on Linux ARM with Briefcase - #4693 — Separate ARM and Intel macOS releases - #4694 — Update developer documentation for Briefcase installer - #4695 — Support upgrade/downgrade with the Briefcase installer - #4696 — Update user documentation for new installer - #4702 — Update Briefcase's Windows template with upstream security fix and OS version check - #4703 — Follow-up tweaks to Linux install/uninstall scripts ## Related PRs - #4619 — Enable Windows ARM64 support - #4632 — Release action --------- Co-authored-by: Abdo <abdo@abdnh.net> Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com> Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com> | 6 months ago | |
chore: Integrate Complexipy for complexity analysis (#4942) ## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The check:complexity Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - just complexipy-diff is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run ./ninja check:complexity locally and confirm it passes. - Test diff mode: just complexipy-diff main. | 5 months ago | |
| 1 year ago | ||
feat: Distribute compiled sources in Briefcase bundle (#4856) ## Linked issue #4855 ## Summary Compile .pyc files and package them in the Briefcase bundle instead of the .py sources. ## How to test You can run this Powershell script to do a basic benchmark of startup performance on Windows (Requires [py-spy](https://github.com/benfred/py-spy)): powershell function Remove-Build { Remove-Item -LiteralPath "./out/installer" -Force -Recurse } function Start-Anki { param ( [Parameter()] [string] $OutputPath ) Start-Process -FilePath "py-spy" -ArgumentList "record --output $OutputPath -- ./out/installer/build/anki/windows/app/src/Anki.exe --safemode" Start-Sleep -Seconds 10 Stop-Process -Name Anki } if ($null -eq (Get-Command "py-spy" -ErrorAction SilentlyContinue)) { Write-Error "py-spy not found. See https://github.com/benfred/py-spy" Exit 1 } git checkout main Remove-Build ./tools/ninja installer:build Start-Anki -OutputPath "main.svg" git checkout briefcase-compile-pyc Remove-Build ./tools/ninja installer:build Start-Anki -OutputPath "pyc.svg" Output is written to main.svg and pyc.svg. Here's an example run (using default 100 sampling rate): <img width="950" height="559" alt="image" src="https://github.com/user-attachments/assets/5da6a06a-3393-4f0e-80fe-ced735d50c2c" /> <img width="830" height="352" alt="image" src="https://github.com/user-attachments/assets/ca9e5d8d-c3d4-4a0b-bd86-7aa2d6c5cee2" /> | 5 months ago | |
Build and publish dev docs (#4579) | 7 months ago | |
Switch to Ruff (#4119) * Add check:ruff build action * Add fix:ruff action * Add Ruff config Mostly generated by Cursor * Handle rest of lints * Fix formatting * Replace black and isort with ruff-format * Run ruff-format * Fix lint errors * Remove pylint disables * Remove .pylintrc * Update docs * Fix check:format not just checking * Fix isort rule being ignored * Sort imports * Ensure ./ninja format also handles import sorting * Remove unused isort cfg * Enable unsafe fixes in fix:ruff, and enable unused var warning * Re-run on config change; enable unnecessary ARG ignores * Use all pycodestyle errors, and add some more commented-out ones Latter logged on https://github.com/ankitects/anki/issues/4135 | 1 year ago | |
Move away from Bazel (#2202) (for upgrading users, please see the notes at the bottom) Bazel brought a lot of nice things to the table, such as rebuilds based on content changes instead of modification times, caching of build products, detection of incorrect build rules via a sandbox, and so on. Rewriting the build in Bazel was also an opportunity to improve on the Makefile-based build we had prior, which was pretty poor: most dependencies were external or not pinned, and the build graph was poorly defined and mostly serialized. It was not uncommon for fresh checkouts to fail due to floating dependencies, or for things to break when trying to switch to an older commit. For day-to-day development, I think Bazel served us reasonably well - we could generally switch between branches while being confident that builds would be correct and reasonably fast, and not require full rebuilds (except on Windows, where the lack of a sandbox and the TS rules would cause build breakages when TS files were renamed/removed). Bazel achieves that reliability by defining rules for each programming language that define how source files should be turned into outputs. For the rules to work with Bazel's sandboxing approach, they often have to reimplement or partially bypass the standard tools that each programming language provides. The Rust rules call Rust's compiler directly for example, instead of using Cargo, and the Python rules extract each PyPi package into a separate folder that gets added to sys.path. These separate language rules allow proper declaration of inputs and outputs, and offer some advantages such as caching of build products and fine-grained dependency installation. But they also bring some downsides: - The rules don't always support use-cases/platforms that the standard language tools do, meaning they need to be patched to be used. I've had to contribute a number of patches to the Rust, Python and JS rules to unblock various issues. - The dependencies we use with each language sometimes make assumptions that do not hold in Bazel, meaning they either need to be pinned or patched, or the language rules need to be adjusted to accommodate them. I was hopeful that after the initial setup work, things would be relatively smooth-sailing. Unfortunately, that has not proved to be the case. Things frequently broke when dependencies or the language rules were updated, and I began to get frustrated at the amount of Anki development time I was instead spending on build system upkeep. It's now about 2 years since switching to Bazel, and I think it's time to cut losses, and switch to something else that's a better fit. The new build system is based on a small build tool called Ninja, and some custom Rust code in build/. This means that to build Anki, Bazel is no longer required, but Ninja and Rust need to be installed on your system. Python and Node toolchains are automatically downloaded like in Bazel. This new build system should result in faster builds in some cases: - Because we're using cargo to build now, Rust builds are able to take advantage of pipelining and incremental debug builds, which we didn't have with Bazel. It's also easier to override the default linker on Linux/macOS, which can further improve speeds. - External Rust crates are now built with opt=1, which improves performance of debug builds. - Esbuild is now used to transpile TypeScript, instead of invoking the TypeScript compiler. This results in faster builds, by deferring typechecking to test/check time, and by allowing more work to happen in parallel. As an example of the differences, when testing with the mold linker on Linux, adding a new message to tags.proto (which triggers a recompile of the bulk of the Rust and TypeScript code) results in a compile that goes from about 22s on Bazel to about 7s in the new system. With the standard linker, it's about 9s. Some other changes of note: - Our Rust workspace now uses cargo-hakari to ensure all packages agree on available features, preventing unnecessary rebuilds. - pylib/anki is now a PEP420 implicit namespace, avoiding the need to merge source files and generated files into a single folder for running. By telling VSCode about the extra search path, code completion now works with generated files without needing to symlink them into the source folder. - qt/aqt can't use PEP420 as it's difficult to get rid of aqt/__init__.py. Instead, the generated files are now placed in a separate _aqt package that's added to the path. - ts/lib is now exposed as @tslib, so the source code and generated code can be provided under the same namespace without a merging step. - MyPy and PyLint are now invoked once for the entire codebase. - dprint will be used to format TypeScript/json files in the future instead of the slower prettier (currently turned off to avoid causing conflicts). It can automatically defer to prettier when formatting Svelte files. - svelte-check is now used for typechecking our Svelte code, which revealed a few typing issues that went undetected with the old system. - The Jest unit tests now work on Windows as well. If you're upgrading from Bazel, updated usage instructions are in docs/development.md and docs/build.md. A summary of the changes: - please remove node_modules and .bazel - install rustup (https://rustup.rs/) - install rsync if not already installed (on windows, use pacman - see docs/windows.md) - install Ninja (unzip from https://github.com/ninja-build/ninja/releases/tag/v1.11.1 and place on your path, or from your distro/homebrew if it's 1.10+) - update .vscode/settings.json from .vscode.dist | 3 years ago | |
Move ascii_percent_encoding into a separate repo This makes it easier to update independently, and means we don't need to exclude it from formatting/tests. | 3 years ago | |
Bump version .1 release skipped due to missing bugfix | 1 year ago | |
chore: add release-age controls for uv and Yarn dependencies (#4761) ## Linked issue Issue related #4747 ## Summary/motivation Add [tool.uv] exclude-newer + required-version, regenerate uv.lock; bump bundled uv binaries in python.rs; bump **Yarn** and npmMinimalAgeGate; remove --no-config from pyenv uv sync --locked so it matches the lockfile. ## How to test - [ ] ./ninja check - [ ] yarn install | 6 months ago | |
chore: Updates just recipes and add AGENTS.md (#4943) ## Linked issue Closes #4836 ## Summary/motivation Three related housekeeping changes to improve AI-agent and developer ergonomics: 1. **justfile**: Expose ./run, ./run.bat (Windows), ./tools/web-watch, ./tools/rebuild-web, and ./tools/clean as just recipes (run, run-optimized, web-watch, rebuild-web, clean), consistent with the Project convention that all commands go through just. 2. **CLAUDE.md**: Add a "Running Anki" section documenting just run and just web-watch; tighten the opening note to explicitly mention ./run. 3. **AGENTS.md**: Add a symlink to CLAUDE.md so that OpenAI Codex and other Agents that look for AGENTS.md pick up the same project instructions. ## How to test - just run launches Anki in dev mode (same as ./run) - just run-optimized launches with RELEASE=1 - just web-watch starts the file-watcher (macOS/Linux) - just clean removes build outputs - AGENTS.md resolves to the same content as CLAUDE.md | 5 months ago | |
chore: Updates just recipes and add AGENTS.md (#4943) ## Linked issue Closes #4836 ## Summary/motivation Three related housekeeping changes to improve AI-agent and developer ergonomics: 1. **justfile**: Expose ./run, ./run.bat (Windows), ./tools/web-watch, ./tools/rebuild-web, and ./tools/clean as just recipes (run, run-optimized, web-watch, rebuild-web, clean), consistent with the Project convention that all commands go through just. 2. **CLAUDE.md**: Add a "Running Anki" section documenting just run and just web-watch; tighten the opening note to explicitly mention ./run. 3. **AGENTS.md**: Add a symlink to CLAUDE.md so that OpenAI Codex and other Agents that look for AGENTS.md pick up the same project instructions. ## How to test - just run launches Anki in dev mode (same as ./run) - just run-optimized launches with RELEASE=1 - just web-watch starts the file-watcher (macOS/Linux) - just clean removes build outputs - AGENTS.md resolves to the same content as CLAUDE.md | 5 months ago | |
feat: render sync server messages as rich text (#4560) ## Summary - Pass type="rich" to showText() when displaying the sync server message, enabling HTML rendering via QTextBrowser.setHtml() - Plain-text messages continue to render identically — setHtml() handles plain strings the same as setPlainText() - Allows self-hosted sync servers to send formatted post-sync messages (e.g. styled statistics, notices with links, tables) ## Context The /sync/meta response includes a msg field that is displayed to the user after sync. The display widget is already a QTextBrowser (which supports Qt rich text/HTML), but showText() is called with the default type="text", routing through setPlainText(). The showText helper already has full HTML support — it just needs type="rich": python # qt/aqt/utils.py text = QTextBrowser() text.setOpenExternalLinks(True) if type == "text": text.setPlainText(txt) # current path else: text.setHtml(txt) # proposed path **Security:** QTextBrowser does not execute JavaScript — only static HTML/CSS. The sync server is explicitly configured and trusted by the user. | 5 months ago | |
chore(deps): consolidated security updates (Dependabot batch) (#4934) ## Summary Consolidates 8 open Dependabot PRs into a single security-focused batch. ### Addressed advisories - GHSA: tar (Cargo) [#296](https://github.com/ankitects/anki/security/dependabot/296) - @tootallnate/once [#295](https://github.com/ankitects/anki/security/dependabot/295) - ws [#293](https://github.com/ankitects/anki/security/dependabot/293) - openssl [#292](https://github.com/ankitects/anki/security/dependabot/292) - idna [#291](https://github.com/ankitects/anki/security/dependabot/291) - devalue [#287](https://github.com/ankitects/anki/security/dependabot/287)/[#239](https://github.com/ankitects/anki/security/dependabot/239)/[#217](https://github.com/ankitects/anki/security/dependabot/217)/[#216](https://github.com/ankitects/anki/security/dependabot/216) - postcss [#275](https://github.com/ankitects/anki/security/dependabot/275) - svelte [#286](https://github.com/ankitects/anki/security/dependabot/286)/[#288](https://github.com/ankitects/anki/security/dependabot/288)/[#289](https://github.com/ankitects/anki/security/dependabot/289) - lodash-es [#258](https://github.com/ankitects/anki/security/dependabot/258)/[#259](https://github.com/ankitects/anki/security/dependabot/259) - @sveltejs/kit [#294](https://github.com/ankitects/anki/security/dependabot/294) ### Sources Merged from PRs: #4914, #4887, #4867, #4866, #4865, #4846, #4744, #4892. ### Not addressed — rand (Cargo) [#268](https://github.com/ankitects/anki/security/dependabot/268) PR #4741 (rand 0.9.4 → 0.10.1) was excluded because fsrs 5.2.0 still depends on rand 0.9.4. The rand 0.10 API changes (Rng → RngExt) cause a compile error at the PostSchedulingFn boundary. This will be unblocked when fsrs is upgraded. ### Not addressed (transitive — follow-up) - urllib3 [#284](https://github.com/ankitects/anki/security/dependabot/284)/[#283](https://github.com/ankitects/anki/security/dependabot/283) - GitPython [#282](https://github.com/ankitects/anki/security/dependabot/282) - ip-address [#276](https://github.com/ankitects/anki/security/dependabot/276) - pytest [#266](https://github.com/ankitects/anki/security/dependabot/266) - Pygments [#256](https://github.com/ankitects/anki/security/dependabot/256) - brace-expansion [#255](https://github.com/ankitects/anki/security/dependabot/255)/[#158](https://github.com/ankitects/anki/security/dependabot/158) - picomatch [#253](https://github.com/ankitects/anki/security/dependabot/253)/[#252](https://github.com/ankitects/anki/security/dependabot/252) - tar (npm) [#238](https://github.com/ankitects/anki/security/dependabot/238)/[#235](https://github.com/ankitects/anki/security/dependabot/235)/[#209](https://github.com/ankitects/anki/security/dependabot/209) - immutable [#231](https://github.com/ankitects/anki/security/dependabot/231) - minimatch [#227](https://github.com/ankitects/anki/security/dependabot/227)/[#226](https://github.com/ankitects/anki/security/dependabot/226)/[#221](https://github.com/ankitects/anki/security/dependabot/221) - fabric [#211](https://github.com/ankitects/anki/security/dependabot/211) These need manual yarn.lock resolutions / uv.lock overrides. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 5 months ago | |
chore(deps): consolidated security updates (Dependabot batch) (#4934) ## Summary Consolidates 8 open Dependabot PRs into a single security-focused batch. ### Addressed advisories - GHSA: tar (Cargo) [#296](https://github.com/ankitects/anki/security/dependabot/296) - @tootallnate/once [#295](https://github.com/ankitects/anki/security/dependabot/295) - ws [#293](https://github.com/ankitects/anki/security/dependabot/293) - openssl [#292](https://github.com/ankitects/anki/security/dependabot/292) - idna [#291](https://github.com/ankitects/anki/security/dependabot/291) - devalue [#287](https://github.com/ankitects/anki/security/dependabot/287)/[#239](https://github.com/ankitects/anki/security/dependabot/239)/[#217](https://github.com/ankitects/anki/security/dependabot/217)/[#216](https://github.com/ankitects/anki/security/dependabot/216) - postcss [#275](https://github.com/ankitects/anki/security/dependabot/275) - svelte [#286](https://github.com/ankitects/anki/security/dependabot/286)/[#288](https://github.com/ankitects/anki/security/dependabot/288)/[#289](https://github.com/ankitects/anki/security/dependabot/289) - lodash-es [#258](https://github.com/ankitects/anki/security/dependabot/258)/[#259](https://github.com/ankitects/anki/security/dependabot/259) - @sveltejs/kit [#294](https://github.com/ankitects/anki/security/dependabot/294) ### Sources Merged from PRs: #4914, #4887, #4867, #4866, #4865, #4846, #4744, #4892. ### Not addressed — rand (Cargo) [#268](https://github.com/ankitects/anki/security/dependabot/268) PR #4741 (rand 0.9.4 → 0.10.1) was excluded because fsrs 5.2.0 still depends on rand 0.9.4. The rand 0.10 API changes (Rng → RngExt) cause a compile error at the PostSchedulingFn boundary. This will be unblocked when fsrs is upgraded. ### Not addressed (transitive — follow-up) - urllib3 [#284](https://github.com/ankitects/anki/security/dependabot/284)/[#283](https://github.com/ankitects/anki/security/dependabot/283) - GitPython [#282](https://github.com/ankitects/anki/security/dependabot/282) - ip-address [#276](https://github.com/ankitects/anki/security/dependabot/276) - pytest [#266](https://github.com/ankitects/anki/security/dependabot/266) - Pygments [#256](https://github.com/ankitects/anki/security/dependabot/256) - brace-expansion [#255](https://github.com/ankitects/anki/security/dependabot/255)/[#158](https://github.com/ankitects/anki/security/dependabot/158) - picomatch [#253](https://github.com/ankitects/anki/security/dependabot/253)/[#252](https://github.com/ankitects/anki/security/dependabot/252) - tar (npm) [#238](https://github.com/ankitects/anki/security/dependabot/238)/[#235](https://github.com/ankitects/anki/security/dependabot/235)/[#209](https://github.com/ankitects/anki/security/dependabot/209) - immutable [#231](https://github.com/ankitects/anki/security/dependabot/231) - minimatch [#227](https://github.com/ankitects/anki/security/dependabot/227)/[#226](https://github.com/ankitects/anki/security/dependabot/226)/[#221](https://github.com/ankitects/anki/security/dependabot/221) - fabric [#211](https://github.com/ankitects/anki/security/dependabot/211) These need manual yarn.lock resolutions / uv.lock overrides. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 5 months ago | |
鸿蒙化 | 5 months ago | |
Drop Pauker and SuperMemo importers from legacy importer The legacy importer has only been kept around to support some add-ons, and these are so infrequently used that they're better off shifted to add-ons (even they even still work) | 1 year ago | |
Add punctuation, convert raw URLs to markdown links in READMEs (#4570) | 7 months ago | |
Update security.md. (#4790) | 5 months ago | |
chore: Integrate Complexipy for complexity analysis (#4942) ## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The check:complexity Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - just complexipy-diff is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run ./ninja check:complexity locally and confirm it passes. - Test diff mode: just complexipy-diff main. | 5 months ago | |
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 | 1 year ago | |
chore(deps): consolidated security updates (Dependabot batch) (#4934) ## Summary Consolidates 8 open Dependabot PRs into a single security-focused batch. ### Addressed advisories - GHSA: tar (Cargo) [#296](https://github.com/ankitects/anki/security/dependabot/296) - @tootallnate/once [#295](https://github.com/ankitects/anki/security/dependabot/295) - ws [#293](https://github.com/ankitects/anki/security/dependabot/293) - openssl [#292](https://github.com/ankitects/anki/security/dependabot/292) - idna [#291](https://github.com/ankitects/anki/security/dependabot/291) - devalue [#287](https://github.com/ankitects/anki/security/dependabot/287)/[#239](https://github.com/ankitects/anki/security/dependabot/239)/[#217](https://github.com/ankitects/anki/security/dependabot/217)/[#216](https://github.com/ankitects/anki/security/dependabot/216) - postcss [#275](https://github.com/ankitects/anki/security/dependabot/275) - svelte [#286](https://github.com/ankitects/anki/security/dependabot/286)/[#288](https://github.com/ankitects/anki/security/dependabot/288)/[#289](https://github.com/ankitects/anki/security/dependabot/289) - lodash-es [#258](https://github.com/ankitects/anki/security/dependabot/258)/[#259](https://github.com/ankitects/anki/security/dependabot/259) - @sveltejs/kit [#294](https://github.com/ankitects/anki/security/dependabot/294) ### Sources Merged from PRs: #4914, #4887, #4867, #4866, #4865, #4846, #4744, #4892. ### Not addressed — rand (Cargo) [#268](https://github.com/ankitects/anki/security/dependabot/268) PR #4741 (rand 0.9.4 → 0.10.1) was excluded because fsrs 5.2.0 still depends on rand 0.9.4. The rand 0.10 API changes (Rng → RngExt) cause a compile error at the PostSchedulingFn boundary. This will be unblocked when fsrs is upgraded. ### Not addressed (transitive — follow-up) - urllib3 [#284](https://github.com/ankitects/anki/security/dependabot/284)/[#283](https://github.com/ankitects/anki/security/dependabot/283) - GitPython [#282](https://github.com/ankitects/anki/security/dependabot/282) - ip-address [#276](https://github.com/ankitects/anki/security/dependabot/276) - pytest [#266](https://github.com/ankitects/anki/security/dependabot/266) - Pygments [#256](https://github.com/ankitects/anki/security/dependabot/256) - brace-expansion [#255](https://github.com/ankitects/anki/security/dependabot/255)/[#158](https://github.com/ankitects/anki/security/dependabot/158) - picomatch [#253](https://github.com/ankitects/anki/security/dependabot/253)/[#252](https://github.com/ankitects/anki/security/dependabot/252) - tar (npm) [#238](https://github.com/ankitects/anki/security/dependabot/238)/[#235](https://github.com/ankitects/anki/security/dependabot/235)/[#209](https://github.com/ankitects/anki/security/dependabot/209) - immutable [#231](https://github.com/ankitects/anki/security/dependabot/231) - minimatch [#227](https://github.com/ankitects/anki/security/dependabot/227)/[#226](https://github.com/ankitects/anki/security/dependabot/226)/[#221](https://github.com/ankitects/anki/security/dependabot/221) - fabric [#211](https://github.com/ankitects/anki/security/dependabot/211) These need manual yarn.lock resolutions / uv.lock overrides. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 5 months ago | |
chore(e2e): add Playwright end-to-end test infrastructure (#4864) ## Linked issue Closes #4863 ## Summary / motivation Adds Playwright as the e2e test framework so contributors can write browser-based tests against a real headless Anki instance. There was no automated way to exercise mediasrv pages, SvelteKit routes, or the /_anki/ RPC surface from a browser, this PR establishes that harness. Key pieces: - qt/tests/launch_anki_for_e2e.py — spawns a throwaway Anki instance (temp ANKI_BASE, QT_QPA_PLATFORM=offscreen). Pre-seeds prefs21.db so Anki skips the language picker and profile chooser and goes straight to serving mediasrv. - playwright.config.ts — points webServer at the launcher; polls /favicon.ico as the readiness probe. - ts/tests/e2e/ — fixtures.ts base and a sanity spec that verifies mediasrv is reachable and a SvelteKit page hydrates. - justfile — just test-e2e recipe; Chromium installed to out/playwright-browsers/. - CI — e2e step in check-linux; failed-run artifacts uploaded for 7 days. - docs/e2e-testing.md — contributor guide covering setup, managed vs reuse-server modes, and writing new tests. ## How to test Build the project once, then run the e2e suite in managed mode (no separate ./run needed — the launcher is started automatically): shell just build just test-e2e ## Before / after behavior (optional) Before: no browser-level test harness existed. After: just test-e2e drives a real headless Anki instance via Playwright. ## Risk / compatibility / migration No production code changed. New dev-only files and CI step only. Chromium is installed to out/playwright-browsers/ (gitignored) and does not affect the regular build. --------- Co-authored-by: Abdo <abdo@abdnh.net> | 5 months ago | |
chore: Integrate Complexipy for complexity analysis (#4942) ## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The check:complexity Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - just complexipy-diff is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run ./ninja check:complexity locally and confirm it passes. - Test diff mode: just complexipy-diff main. | 5 months ago | |
fix: Use Powershell to run just commands on Windows (#4921) ## Linked issue Closes #4920 ## Summary Default to PowerShell 7+ to run just commands on Windows for more consistent argument quoting rules. ## Steps to reproduce (before) - Trigger the release workflow: just release::build --ref main. - Inspect the logs of the prepare step on GitHub and notice that the version has literal double quotes. ## How to test (after) Repeat the same steps and confirm quotes are not passed literally. | 5 months ago | |
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 | 1 year ago | |
One step closer to tools/run-qt* on Windows Doing the rest manually for now | 1 year ago | |
Update to Rust 1.92 (#4461) * Update to Rust 1.90 * Fix clippy errors * Update to 1.92 * Update cargo-deny again Deno crate was using a CVSS version 4.0, which wasn't supported --------- Co-authored-by: Damien Elmes <gpg@ankiweb.net> | 9 months ago | |
chore: Integrate Complexipy for complexity analysis (#4942) ## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The check:complexity Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - just complexipy-diff is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run ./ninja check:complexity locally and confirm it passes. - Test diff mode: just complexipy-diff main. | 5 months ago | |
Do JS license output from top-level script | 8 months ago | |
Switch to SvelteKit (#3077) * Update to latest Node LTS * Add sveltekit * Split tslib into separate @generated and @tslib components SvelteKit's path aliases don't support multiple locations, so our old approach of using @tslib to refer to both ts/lib and out/ts/lib will no longer work. Instead, all generated sources and their includes are placed in a separate out/ts/generated folder, and imported via @generated instead. This also allows us to generate .ts files, instead of needing to output separate .d.ts and .js files. * Switch package.json to module type * Avoid usage of baseUrl Incompatible with SvelteKit * Move sass into ts; use relative links SvelteKit's default sass support doesn't allow overriding loadPaths * jest->vitest, graphs example working with yarn dev * most pages working in dev mode * Some fixes after rebasing * Fix/silence some svelte-check errors * Get image-occlusion working with Fabric types * Post-rebase lock changes * Editor is now checked * SvelteKit build integrated into ninja * Use the new SvelteKit entrypoint for pages like congrats/deck options/etc * Run eslint once for ts/**; fix some tests * Fix a bunch of issues introduced when rebasing over latest main * Run eslint fix * Fix remaining eslint+pylint issues; tests now all pass * Fix some issues with a clean build * Latest bufbuild no longer requires @__PURE__ hack * Add a few missed dependencies * Add yarn.bat to fix Windows build * Fix pages failing to show when ANKI_API_PORT not defined * Fix svelte-check and vitest on Windows * Set node path in ./yarn * Move svelte-kit output to ts/.svelte-kit Sadly, I couldn't figure out a way to store it in out/ if out/ is a symlink, as it breaks module resolution when SvelteKit is run. * Allow HMR inside Anki * Skip SvelteKit build when HMR is defined * Fix some post-rebase issues I should have done a normal merge instead. | 2 years ago | |
chore(deps): consolidated security updates (Dependabot batch) (#4934) ## Summary Consolidates 8 open Dependabot PRs into a single security-focused batch. ### Addressed advisories - GHSA: tar (Cargo) [#296](https://github.com/ankitects/anki/security/dependabot/296) - @tootallnate/once [#295](https://github.com/ankitects/anki/security/dependabot/295) - ws [#293](https://github.com/ankitects/anki/security/dependabot/293) - openssl [#292](https://github.com/ankitects/anki/security/dependabot/292) - idna [#291](https://github.com/ankitects/anki/security/dependabot/291) - devalue [#287](https://github.com/ankitects/anki/security/dependabot/287)/[#239](https://github.com/ankitects/anki/security/dependabot/239)/[#217](https://github.com/ankitects/anki/security/dependabot/217)/[#216](https://github.com/ankitects/anki/security/dependabot/216) - postcss [#275](https://github.com/ankitects/anki/security/dependabot/275) - svelte [#286](https://github.com/ankitects/anki/security/dependabot/286)/[#288](https://github.com/ankitects/anki/security/dependabot/288)/[#289](https://github.com/ankitects/anki/security/dependabot/289) - lodash-es [#258](https://github.com/ankitects/anki/security/dependabot/258)/[#259](https://github.com/ankitects/anki/security/dependabot/259) - @sveltejs/kit [#294](https://github.com/ankitects/anki/security/dependabot/294) ### Sources Merged from PRs: #4914, #4887, #4867, #4866, #4865, #4846, #4744, #4892. ### Not addressed — rand (Cargo) [#268](https://github.com/ankitects/anki/security/dependabot/268) PR #4741 (rand 0.9.4 → 0.10.1) was excluded because fsrs 5.2.0 still depends on rand 0.9.4. The rand 0.10 API changes (Rng → RngExt) cause a compile error at the PostSchedulingFn boundary. This will be unblocked when fsrs is upgraded. ### Not addressed (transitive — follow-up) - urllib3 [#284](https://github.com/ankitects/anki/security/dependabot/284)/[#283](https://github.com/ankitects/anki/security/dependabot/283) - GitPython [#282](https://github.com/ankitects/anki/security/dependabot/282) - ip-address [#276](https://github.com/ankitects/anki/security/dependabot/276) - pytest [#266](https://github.com/ankitects/anki/security/dependabot/266) - Pygments [#256](https://github.com/ankitects/anki/security/dependabot/256) - brace-expansion [#255](https://github.com/ankitects/anki/security/dependabot/255)/[#158](https://github.com/ankitects/anki/security/dependabot/158) - picomatch [#253](https://github.com/ankitects/anki/security/dependabot/253)/[#252](https://github.com/ankitects/anki/security/dependabot/252) - tar (npm) [#238](https://github.com/ankitects/anki/security/dependabot/238)/[#235](https://github.com/ankitects/anki/security/dependabot/235)/[#209](https://github.com/ankitects/anki/security/dependabot/209) - immutable [#231](https://github.com/ankitects/anki/security/dependabot/231) - minimatch [#227](https://github.com/ankitects/anki/security/dependabot/227)/[#226](https://github.com/ankitects/anki/security/dependabot/226)/[#221](https://github.com/ankitects/anki/security/dependabot/221) - fabric [#211](https://github.com/ankitects/anki/security/dependabot/211) These need manual yarn.lock resolutions / uv.lock overrides. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 5 months ago |
Anki
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.
This repo contains the source code for the computer version of Anki.
Getting Started
Contributing
Want to contribute to Anki? Check out the Contribution Guidelines.
For more information on building and developing, please see Development.
Contributors
The following people have contributed to Anki: CONTRIBUTORS
Anki Betas
If you'd like to try development builds of Anki but don't feel comfortable building the code, please see Anki betas.
License
Anki's license: LICENSE