Commit graph

8938 commits

Author SHA1 Message Date
Damien Elmes
43be693cc5 set local=False for python/protoc/clang
Suspect this will fix these repos being unnecessarily restarted on
changes to the workspace.
2021-11-01 11:38:20 +10:00
Damien Elmes
032c7e49c3 allow passing npm repo name in compile_svelte() 2021-10-31 18:10:11 +10:00
Damien Elmes
a3a9523f6f use absolute path for sql_format 2021-10-31 11:13:38 +10:00
Henrik Giesel
d74c38abe5 Several CSS fixes - Editor Cleanup (#1470)
* Refactor editor css, fix editor button highlight

- Avoid using webview.css
- Move more buttons css into button_mixins

* Fix DropdownItem appearance

* Fix the visuals of tags

* Make dropdown font slightly smaller

* Give SelectOption a background color

* Move some css from deck-options-base to CardStateCustomizer

* Avoid using core.scss for CardStats

* Avoid using sass/core in congrats package

* Inline core.scss into webview.scss

* Include fusion-vars for base.scss

* need to keep core.scss around for now (dae)
2021-10-31 08:29:22 +10:00
Matthias Metelka
f85e2e8cef Highlight field badges when toggled to non-default state (#1466) 2021-10-31 07:48:37 +10:00
Damien Elmes
82ab53c249 fix ts-run
Closes #1468
2021-10-30 09:14:43 +10:00
Damien Elmes
8ef362e7ed fix scripts/mypy*
Broken in switch to rules_python
2021-10-30 09:14:43 +10:00
Damien Elmes
455e0ce63b fix sort order toggling
We're getting an enum instead of an int in Qt6

normal/reversed have been renamed to ascending/descending; no add-ons
appear to be using the old versions.
2021-10-30 09:14:43 +10:00
Damien Elmes
670690fd64 fix broken startup on macOS due to incorrect mpv path 2021-10-30 09:14:43 +10:00
Damien Elmes
ce12b00c8e fix missing protobuf C extension on darwin-arm 2021-10-30 09:14:43 +10:00
RumovZ
e49b81bf88 Disable renaming of no-flag item (#1467) 2021-10-30 09:08:51 +10:00
RumovZ
d62d23c525 Use backend for getting deck children (#1465)
* Add backend routine for child deck names and ids

* Use backend for getting deck children

Instead of flawed case-sensitive Python logic.
2021-10-29 19:43:17 +10:00
Damien Elmes
0facadcf91 ignore requested graphics driver on Qt6 for now 2021-10-29 19:34:05 +10:00
Damien Elmes
a3c7628931 avoid printing compat warning on Qt5 2021-10-29 19:29:12 +10:00
Damien Elmes
c0a812cf9a tweaks for Linux package 2021-10-29 19:26:35 +10:00
Damien Elmes
56e432cf16 tweaks for Windows package
- move audio tools into subfolder
- add buildmanifest.py
2021-10-29 18:11:28 +10:00
Damien Elmes
951339a6fa show warning instead of crashing when recording on darwin-arm64 2021-10-29 14:43:59 +10:00
Damien Elmes
6774f81895 rename some of the files in aqt/qt/ 2021-10-29 13:54:24 +10:00
Damien Elmes
faf4ddf55f remove PyQt 6.2.0 workarounds
Fixed in the 6.2.1 release, and attempting to sign again on ARM
breaks the build.
2021-10-29 13:48:39 +10:00
Damien Elmes
a1a65fe4ff fix new cards not being correctly limited
https://forums.ankiweb.net/t/ios-beta-20080-2-more-new-cards-after-review-limit-is-met/13728/10
2021-10-29 12:12:34 +10:00
Damien Elmes
5f929cc959 add a flag to disable PyQt5 compat 2021-10-29 10:08:07 +10:00
Damien Elmes
62ec17adc6 fix missing icons in browse screen
Introduced in 4a0fa32d3c
2021-10-29 10:08:07 +10:00
Damien Elmes
4ce839b8d8 update to PyQt 6.2.1 2021-10-29 08:40:22 +10:00
Damien Elmes
4a0fa32d3c print a deprecation warning for old-style enums
https://github.com/ankitects/anki/pull/1440#issuecomment-948622876
2021-10-28 20:21:52 +10:00
Damien Elmes
a898940b75 use aqt.qt to (partially) mock the old PyQt5 module
We can't import the Qt5 libraries to do it - they are not usually
available, and it will lead to crashes if both are imported at once.
2021-10-28 20:17:18 +10:00
Aristotelis
a2b1deacba 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
Henrik Giesel
915b638dcc Fix DeckOptions toolbar having wrong margins and no flex-grow (#1464)
ButtonToolbar.svelte now has to assume that the button elements
are two levels below it. This can be simplified once we can use
flex-gap.
2021-10-28 19:37:52 +10:00
RumovZ
008fa9692b Fix quotation of "and" and "or" in search (#1463) 2021-10-28 19:23:56 +10:00
RumovZ
67ca3308a5 Stop trimming filename references before encoding (#1462)
Closes  #1430
2021-10-28 19:22:51 +10:00
Damien Elmes
d2fc9ee608 ignore a spurious mypy error 2021-10-28 19:19:37 +10:00
Damien Elmes
0509362da4 Merge branch 'packaging'
An experimental new approach based on PyOxidizer instead of PyInstaller.

PyInstaller doesn't currently define __file__ in bundled files, so a
few parts of the code that were referencing __file__ directly needed
to be updated. The root_path argument to flask is for the same reason -
it tries to look up __file__ without it.
2021-10-28 18:58:20 +10:00
Damien Elmes
8c830f3eea make console optional on Windows 2021-10-28 18:57:21 +10:00
Damien Elmes
73160fd16c updated package scripts 2021-10-28 18:46:45 +10:00
Damien Elmes
61f103f522 use ResourceReader for serving bundled web files 2021-10-28 18:31:12 +10:00
Damien Elmes
8b706c8141 add missing wheel/helper for darwin-arm64 2021-10-28 18:29:18 +10:00
Damien Elmes
87b94a27fa support args to ts-run 2021-10-26 20:11:35 +10:00
Abdo
9e97ac1023 Strip isolation chars from deck options warnings to fix RTL display (#1457)
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2021-10-26 20:11:25 +10:00
Damien Elmes
cf831587e1 mention glibc requirements
https://forums.ankiweb.net/t/wheel-not-supported-on-the-platform-which-built-it/14432
2021-10-26 18:08:08 +10:00
Damien Elmes
ed7d090097 bump version 2021-10-26 14:14:20 +10:00
Damien Elmes
eee17476e3 fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
Damien Elmes
409804a717 update translations 2021-10-26 08:30:13 +10:00
Damien Elmes
6c3f4c167c fix missing dependencies on ftl:sync 2021-10-26 08:30:13 +10:00
Damien Elmes
fb3e6db1c7 update js deps 2021-10-26 08:30:13 +10:00
Damien Elmes
dae1854106 update Rust deps with cargo-raze 0.13.0 2021-10-26 08:16:40 +10:00
Damien Elmes
e8aa04334f arch is not in POSIX
7971472c65 (commitcomment-58626200)
2021-10-26 08:06:12 +10:00
RumovZ
805beef792 Enable invalid-name globally in pylib (#1454) 2021-10-25 19:10:56 +10:00
RumovZ
fe514ddb30 PEP8 for rest of pylib (#1451)
* PEP8 dbproxy.py

* PEP8 errors.py

* PEP8 httpclient.py

* PEP8 lang.py

* PEP8 latex.py

* Add decorator to deprectate key words

* Make replacement for deprecated attribute optional

* Use new helper `_print_replacement_warning()`

* PEP8 media.py

* PEP8 rsbackend.py

* PEP8 sound.py

* PEP8 stdmodels.py

* PEP8 storage.py

* PEP8 sync.py

* PEP8 tags.py

* PEP8 template.py

* PEP8 types.py

* Fix DeprecatedNamesMixinForModule

The class methods need to be overridden with instance methods, so every
module has its own dicts.

* Use `# pylint: disable=invalid-name` instead of id

* PEP8 utils.py

* Only decorate `__getattr__` with `@no_type_check`

* Fix mypy issue with snakecase

Importing it from `anki._vendor` raises attribute errors.

* Format

* Remove inheritance of DeprecatedNamesMixin

There's almost no shared code now and overriding classmethods with
instance methods raises mypy issues.

* Fix traceback frames of deprecation warnings

* remove fn/TimedLog (dae)

Neither Anki nor add-ons appear to have been using it

* fix some issues with stringcase use (dae)

- the wheel was depending on the PyPI version instead of our vendored
version
- _vendor:stringcase should not have been listed in the anki py_library.
We already include the sources in py_srcs, and need to refer to them
directly. By listing _vendor:stringcase as well, we were making a
top-level stringcase library available, which would have only worked for
distributing because the wheel definition was also incorrect.
- mypy errors are what caused me to mistakenly add the above - they
were because the type: ignore at the top of stringcase.py was causing
mypy to completely ignore the file, so it was not aware of any attributes
it contained.
2021-10-25 14:50:13 +10:00
Abdo
6c17be7cb3 Flip sidebar position for RTL languages (#1453) 2021-10-25 13:27:19 +10:00
Hikaru Y
0ba17c066c Fix chooser label not being updated when current notetype/deck renamed (#1452)
* Switch to PEP 604 syntax

* Fix chooser label not being updated when current notetype/deck renamed

- fixes #1450
- fixes https://forums.ankiweb.net/t/deck-name-not-updated/14330
2021-10-25 13:23:06 +10:00
Damien Elmes
578985e2e5 update hashes for new darwin-arm64 pyqt6 wheels
https://www.riverbankcomputing.com/pipermail/pyqt/2021-October/044317.html

Should fix Mac CI.
2021-10-25 13:12:30 +10:00