Anki/pylib/anki
Damien Elmes 616db33c0e refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:

- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.

The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.

The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.

Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 19:17:05 +10:00
..
_backend refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
importing fixed inability to import v1 into v1 2021-07-08 10:32:44 +10:00
scheduler refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
syncserver refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
__init__.py minor code cleanups with pyupgrade 2021-02-11 09:43:40 +10:00
_legacy.py PEP8 models.py 2021-06-27 14:30:00 +10:00
backend_pb2.pyi refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
browser.py Add pylib/browser.py for literal config keys 2021-07-05 12:44:48 +02:00
BUILD.bazel refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
buildinfo.py run black/isort on Python scripts 2021-04-14 18:22:02 +10:00
cards.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
collection.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
config.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
consts.py fix documentation links 2021-06-03 16:51:03 +10:00
db.py add some typehints, and remove some unused code 2021-01-31 20:56:21 +10:00
dbproxy.py commit immediately when there's no active checkpoint 2021-03-10 11:47:53 +10:00
decks.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
errors.py simplify errors 2021-04-03 16:06:46 +10:00
exporting.py PEP8 collection.py 2021-06-27 15:12:22 +10:00
find.py ID -> Id in protobuf and Python 2021-03-27 21:38:20 +10:00
generic_pb2.pyi refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
hooks.py add more typing, and enable checks for missing types for most of pylib 2021-01-31 21:38:36 +10:00
hooks_gen.py symlink generated .py/.pyi into tree to fix Python code completion 2020-12-16 11:36:42 +10:00
httpclient.py minor code cleanups with pyupgrade 2021-02-11 09:43:40 +10:00
i18n_pb2.pyi refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
lang.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
latex.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
media.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
models.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
notes.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
py.typed mark anki and aqt modules as having typing info 2020-01-13 13:03:37 +10:00
rsbackend.py fix rsbackend compat issues 2021-02-08 09:51:51 +10:00
sound.py support speed control in tts tags 2020-01-26 14:31:07 +10:00
stats.py PEP8 collection.py 2021-06-27 15:12:22 +10:00
statsbg.py tweaking the folder names again 2020-01-03 07:48:38 +10:00
stdmodels.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
storage.py storage->collection 2020-05-20 17:58:28 +10:00
sync.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
tags.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
template.py refactor protobuf handling for split/import 2021-07-10 19:17:05 +10:00
types.py add missing copyright headers to *.py 2021-04-13 18:45:35 +10:00
utils.py move+rename deprecated decorators to _legacy.py 2021-06-26 15:50:19 +10:00
wheel_description.txt move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00