diff --git a/.gitignore b/.gitignore index 37d4319f9..281c532d6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ .pytype __pycache__ anki/buildhash.py -anki/bridge_pb2.py +anki/bridge_pb2.* aqt/forms locale rs/ankirs/src/proto.rs diff --git a/Makefile b/Makefile index 79d4aab0d..9bdbd6bfa 100644 --- a/Makefile +++ b/Makefile @@ -130,7 +130,7 @@ BUILDDEPS := .build/ui .build/js .build/rs .build/py-proto @touch $@ .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 $@ .PHONY: build clean diff --git a/anki/rsbridge.py b/anki/rsbridge.py index 9e294c4f8..58dc753ec 100644 --- a/anki/rsbridge.py +++ b/anki/rsbridge.py @@ -1,3 +1,5 @@ +# pylint: skip-file + from typing import Dict, List import _ankirs # pytype: disable=import-error @@ -66,4 +68,5 @@ class RSBridge: ) ) 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) diff --git a/requirements.check b/requirements.check index aee07e685..ebe707bba 100644 --- a/requirements.check +++ b/requirements.check @@ -6,3 +6,4 @@ git+https://github.com/dae/isort#egg=isort # fixme: when pylint supports isort 5.0, switch to pypy git+https://github.com/dae/pylint#egg=pylint black +mypy_protobuf \ No newline at end of file