Go to file
Aristotelis 2d1c058106
Maintain compatibility with PyQt5 add-ons in PyQt6 builds (#1440)
* Alias PyQt5 to PyQt6 on PyQt6 builds

Restores basic compatibility with PyQt5 add-ons

* Register QtCore early to work around sip error

* Monkey-patch unscoped enums that are in use by add-ons back in

Enums whose namespace moved with PyQt6 were determined using the tooling in https://github.com/qutebrowser/qutebrowser/issues/5904

Relevant enums for the Anki add-on ecosystem were found by grepping through all AnkiWeb add-ons and a selection of GitHub-released add-ons.

* Add full Qt.Key namespace

Maintains compatibility with add-ons that allow specifying key bindings via Qt.Key enums

* Reintroduce PyQt6.Qt as an alias for QtCore.Qt

* Alias classes shifted from QtWidgets to QtGui

* Add missing enums

Adds ≈200 enums that were missed during the initial grep

* Map exec_ calls to exec

* Tweak section headers

* Fix QtWebEngineWidgets imports failing due to delayed import

Addesses: "QtWebEngineWidgets must be imported before a QCoreApplication instance is created"

* Register additional aliases for top-level Qt modules

Given how we have had to deal with side-effects when not registering other aliased imports ahead of time, it seems safer to also register the remaining few with sys.modules.

* Handle calls to deprecated PyQt resource API graciously

* Create QtWebEngineWidgets aliases for classes moved to QtWebEngineCore

* Alias QShortcut

* Restore QWebEnginePage.view()

* Alias sip to PyQt6.sip

* Alias QtCore.QRegExp to QtCore.QRegularExpression

* Restructure aqt.qt into package

Pre-requirement for aliasing the PyQt5.Qt namespace correctly.

Should hopefully also make it easier to keep an overview as Qt-compat-related modules were proliferating.

* Properly alias PyQt5.Qt

PyQt5.Qt used to serve as a common namespace for all Qt classes, not just QtCore.Qt.*

While this changes does not make all classes accessible via PyQt5.Qt, it does so for the most important Qt submodules, which should cover most add-on breakages.

* Simplify Qt resource system legacy handling

* Also alias PyQt6.Qt

Covers imports of the form `from PyQt5 import import Qt` (due to previous aliasing of PyQt5 to PyQt6)

* Add missing enums

Better approach to grepping through add-ons yielded additional hits

* Run formatters

* Satisfy pylint
2021-10-28 19:57:42 +10:00
.buildkite move node_modules into root folder [action required] 2021-10-07 11:42:27 +10:00
.github/ISSUE_TEMPLATE add issue template config.yml 2021-02-19 14:11:21 +10:00
cargo update Rust deps with cargo-raze 0.13.0 2021-10-26 08:16:40 +10:00
docs mention glibc requirements 2021-10-26 18:08:08 +10:00
ftl fix missing dependencies on ftl:sync 2021-10-26 08:30:13 +10:00
platforms use x86 binaries for clang format/protobuf on Mac 2021-10-16 18:07:39 +10:00
proto fixes and documentation for Linux ARM64 2021-10-23 15:22:24 +10:00
pylib updated package scripts 2021-10-28 18:46:45 +10:00
python arch is not in POSIX 2021-10-26 08:06:12 +10:00
qt Maintain compatibility with PyQt5 add-ons in PyQt6 builds (#1440) 2021-10-28 19:57:42 +10:00
rslib Fix quotation of "and" and "or" in search (#1463) 2021-10-28 19:23:56 +10:00
sass Fix RTL text display being off + Update PlainTextInput RTL on save (#1448) 2021-10-23 11:06:15 +10:00
scripts updated package scripts 2021-10-28 18:46:45 +10:00
ts Fix DeckOptions toolbar having wrong margins and no flex-grow (#1464) 2021-10-28 19:37:52 +10:00
.bazelignore move node_modules into root folder [action required] 2021-10-07 11:42:27 +10:00
.bazelrc default to a vendored copy of Python 2021-10-15 22:14:05 +10:00
.bazelversion update Bazel version 2021-10-01 20:54:48 +10:00
.gitattributes try again to improve GitHub's language stats 2021-01-20 13:20:45 +10:00
.gitignore move node_modules into root folder [action required] 2021-10-07 11:42:27 +10:00
.prettierignore Fix prettier after moving node_modules to repo dir (#1413) 2021-10-09 10:13:14 +10:00
.prettierrc Use trailingComma: all setting in .prettierrc (#1435) 2021-10-19 09:06:00 +10:00
bazel.bat initial Bazel conversion 2020-11-01 14:26:58 +10:00
BUILD.bazel Fix prettier after moving node_modules to repo dir (#1413) 2021-10-09 10:13:14 +10:00
Cargo.lock update Rust deps with cargo-raze 0.13.0 2021-10-26 08:16:40 +10:00
Cargo.toml updated package scripts 2021-10-28 18:46:45 +10:00
CONTRIBUTORS add new hook: add_cards_did_change_deck (#1420) 2021-10-12 17:55:21 +10:00
defs.bzl bump version 2021-10-26 14:14:20 +10:00
late_deps.bzl download wheels using rules_python 2021-10-15 16:02:26 +10:00
LICENSE move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
package.json Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
pkgkey.asc add public key for release signing 2018-09-18 10:40:45 +10:00
README.md fix build badge 2021-06-24 09:21:56 +10:00
repos.bzl updated package scripts 2021-10-28 18:46:45 +10:00
run get PyQt working directly with ./run on macOS 2021-10-16 18:07:29 +10:00
run.bat enable Python warnings when running 2020-12-16 14:59:04 +10:00
SECURITY.md add SECURITY.md 2021-09-22 22:55:19 +10:00
WORKSPACE move node_modules into root folder [action required] 2021-10-07 11:42:27 +10:00
yarn.lock update js deps 2021-10-26 08:30:13 +10:00

Anki

Build status

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

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see https://betas.ankiweb.net/

For more information on building, please see Development.