mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
orjson was missing from dep list; drop 32 bit compat
This commit is contained in:
parent
835c29f8ca
commit
b0aedd6c76
4 changed files with 10 additions and 13 deletions
|
@ -10,6 +10,7 @@ markdown
|
|||
mock
|
||||
mypy
|
||||
mypy-protobuf
|
||||
orjson
|
||||
pip-tools
|
||||
protobuf
|
||||
pylint
|
||||
|
|
|
@ -28,6 +28,7 @@ mock==4.0.2 # via -r requirements.in
|
|||
mypy-extensions==0.4.3 # via black, mypy
|
||||
mypy-protobuf==1.23 # via -r requirements.in
|
||||
mypy==0.790 # via -r requirements.in
|
||||
orjson==3.4.3 # via -r requirements.in
|
||||
packaging==20.4 # via pytest
|
||||
pathspec==0.8.0 # via black
|
||||
pip-tools==5.3.1 # via -r requirements.in
|
||||
|
|
|
@ -85,11 +85,12 @@ py_library(
|
|||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
requirement("protobuf"),
|
||||
requirement("beautifulsoup4"),
|
||||
requirement("decorator"),
|
||||
requirement("distro"),
|
||||
requirement("orjson"),
|
||||
requirement("protobuf"),
|
||||
requirement("requests"),
|
||||
requirement("beautifulsoup4"),
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -106,7 +107,6 @@ py_wheel(
|
|||
distribution = "anki",
|
||||
platform = select({
|
||||
"//platforms:windows_x86_64": "win_amd64",
|
||||
"//platforms:windows_x86_32": "win32",
|
||||
"//platforms:macos_x86_64": "macosx_10_7_x86_64",
|
||||
"//platforms:linux_x86_64": "manylinux2014_x86_64",
|
||||
"//platforms:linux_x86_32": "manylinux2014_i686",
|
||||
|
@ -118,7 +118,7 @@ py_wheel(
|
|||
"requests[socks]",
|
||||
"decorator",
|
||||
"protobuf",
|
||||
'orjson; platform_machine == "x86_64"',
|
||||
"orjson",
|
||||
'psutil; sys_platform == "win32"',
|
||||
'distro; sys_platform != "darwin" and sys_platform != "win32"',
|
||||
],
|
||||
|
|
|
@ -21,6 +21,8 @@ import json
|
|||
import os
|
||||
from dataclasses import dataclass
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Union
|
||||
import orjson
|
||||
|
||||
|
||||
import anki._rsbridge
|
||||
import anki.backend_pb2 as pb
|
||||
|
@ -59,15 +61,8 @@ SyncOutput = pb.SyncCollectionOut
|
|||
SyncStatus = pb.SyncStatusOut
|
||||
CountsForDeckToday = pb.CountsForDeckTodayOut
|
||||
|
||||
try:
|
||||
import orjson
|
||||
|
||||
to_json_bytes = orjson.dumps
|
||||
from_json_bytes = orjson.loads
|
||||
except:
|
||||
# add compat layer for 32 bit builds that can't use orjson
|
||||
to_json_bytes = lambda obj: json.dumps(obj).encode("utf8") # type: ignore
|
||||
from_json_bytes = json.loads
|
||||
|
||||
|
||||
class Interrupted(Exception):
|
||||
|
|
Loading…
Reference in a new issue