mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
generate type stubs for Protobuf; disable pylint on rsbridge
This commit is contained in:
parent
b54c127372
commit
280b010493
4 changed files with 7 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -10,7 +10,7 @@
|
||||||
.pytype
|
.pytype
|
||||||
__pycache__
|
__pycache__
|
||||||
anki/buildhash.py
|
anki/buildhash.py
|
||||||
anki/bridge_pb2.py
|
anki/bridge_pb2.*
|
||||||
aqt/forms
|
aqt/forms
|
||||||
locale
|
locale
|
||||||
rs/ankirs/src/proto.rs
|
rs/ankirs/src/proto.rs
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -130,7 +130,7 @@ BUILDDEPS := .build/ui .build/js .build/rs .build/py-proto
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
.build/py-proto: $(RUNREQS) $(PROTODEPS)
|
.build/py-proto: $(RUNREQS) $(PROTODEPS)
|
||||||
protoc --proto_path=proto --python_out=anki proto/bridge.proto
|
protoc --proto_path=proto --python_out=anki --mypy_out=anki proto/bridge.proto
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
.PHONY: build clean
|
.PHONY: build clean
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# pylint: skip-file
|
||||||
|
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
|
|
||||||
import _ankirs # pytype: disable=import-error
|
import _ankirs # pytype: disable=import-error
|
||||||
|
@ -66,4 +68,5 @@ class RSBridge:
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
output = self._run_command(input).template_requirements
|
output = self._run_command(input).template_requirements
|
||||||
return proto_template_reqs_to_legacy(output.requirements)
|
reqs: List[pb.TemplateRequirement] = output.requirements # type: ignore
|
||||||
|
return proto_template_reqs_to_legacy(reqs)
|
||||||
|
|
|
@ -6,3 +6,4 @@ git+https://github.com/dae/isort#egg=isort
|
||||||
# fixme: when pylint supports isort 5.0, switch to pypy
|
# fixme: when pylint supports isort 5.0, switch to pypy
|
||||||
git+https://github.com/dae/pylint#egg=pylint
|
git+https://github.com/dae/pylint#egg=pylint
|
||||||
black
|
black
|
||||||
|
mypy_protobuf
|
Loading…
Reference in a new issue