anki/pip/stubs/BUILD.bazel
Damien Elmes d120cd7f8a update to latest mypy
mypy's move to external types-* packages is a PITA, as it requires them
to be installed in site-packages, and provides no way to specify a custom
site-packages folder, necessitating extra scripts to mock the
site-packages path, and copy+rename the stub packages into a separate
folder.
2021-06-16 16:04:59 +10:00

43 lines
847 B
Python

load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load("@py_deps//:requirements.bzl", "requirement")
load(":stubs.bzl", "copy_stubs")
_stubs = [
"requests",
"protobuf",
"decorator",
"flask",
"markdown",
"orjson",
"waitress",
]
py_binary(
name = "gatherstubs",
srcs = [
"gatherstubs.py",
],
visibility = ["//visibility:public"],
deps = [
requirement("mypy"),
] + [requirement("types-" + stub) for stub in _stubs],
)
py_binary(
name = "extendsitepkgs",
srcs = [
"extendsitepkgs.py",
],
visibility = ["//visibility:public"],
deps = [
requirement("mypy"),
],
)
copy_stubs(
name = "stubs",
pkgs = [requirement("types-" + stub) for stub in _stubs],
tool = ":gatherstubs",
visibility = ["//visibility:public"],
)