symlink generated .py/.pyi into tree to fix Python code completion

This commit is contained in:
Damien Elmes 2020-12-16 11:36:42 +10:00
parent dee0a2fc18
commit 53276b3044
10 changed files with 30 additions and 18 deletions

3
pylib/.gitignore vendored
View File

@ -10,8 +10,5 @@
.pytype
__pycache__
anki.egg-info
anki/backend_pb2.*
anki/fluent_pb2.*
anki/rsbackend_gen.py
build
dist

View File

@ -1 +0,0 @@
buildinfo.py

View File

@ -65,11 +65,17 @@ alias(
visibility = ["//visibility:public"],
)
_py_srcs = glob(
["**/*.py"],
exclude = [
"rsbackend_gen.py",
"hooks_gen.py",
],
)
py_library(
name = "anki",
srcs = glob([
"**/*.py",
]),
srcs = _py_srcs,
data = [
"py.typed",
":backend_pb2",
@ -130,7 +136,7 @@ py_wheel(
filegroup(
name = "py_source_files",
srcs = glob(["**/*.py"]),
srcs = _py_srcs,
visibility = [
"//pylib:__subpackages__",
"//qt/po:__pkg__",

1
pylib/anki/backend_pb2.pyi Symbolic link
View File

@ -0,0 +1 @@
../../bazel-bin/pylib/anki/backend_pb2.pyi

1
pylib/anki/fluent_pb2.pyi Symbolic link
View File

@ -0,0 +1 @@
../../bazel-bin/pylib/anki/fluent_pb2.pyi

1
pylib/anki/hooks_gen.py Symbolic link
View File

@ -0,0 +1 @@
../../bazel-bin/pylib/anki/hooks_gen.py

1
pylib/anki/rsbackend_gen.py Symbolic link
View File

@ -0,0 +1 @@
../../bazel-bin/pylib/anki/rsbackend_gen.py

View File

@ -83,9 +83,9 @@ py_test(
py_test(
name = "format_check",
srcs = glob([
"**/*.py",
]),
srcs = glob(["**/*.py"]) + [
"//qt/aqt:py_source_files",
],
args = [
"$(location .isort.cfg)",
],

View File

@ -23,9 +23,14 @@ genrule(
],
)
aqt_srcs = glob([
"**/*.py",
]) + [
_py_srcs = glob(
[
"**/*.py",
],
exclude = ["hooks_gen.py"],
)
_py_srcs_and_forms = _py_srcs + [
"//qt/aqt/forms:forms",
"//qt/aqt/forms:icons",
]
@ -59,7 +64,7 @@ aqt_deps = [
# library without web/i18n data; faster for testing
py_library(
name = "aqt_without_data",
srcs = aqt_srcs,
srcs = _py_srcs_and_forms,
data = aqt_core_data,
visibility = ["//visibility:public"],
deps = aqt_deps,
@ -67,7 +72,7 @@ py_library(
py_library(
name = "aqt_with_data",
srcs = aqt_srcs,
srcs = _py_srcs_and_forms,
data = aqt_core_data + ["//qt/aqt/data"],
visibility = ["//visibility:public"],
deps = aqt_deps,
@ -122,8 +127,8 @@ py_wheel(
filegroup(
name = "py_source_files",
srcs = glob(["**/*.py"]),
srcs = _py_srcs,
visibility = [
"//qt/po:__pkg__",
"//qt:__subpackages__",
],
)

1
qt/aqt/hooks_gen.py Symbolic link
View File

@ -0,0 +1 @@
../../bazel-bin/qt/aqt/hooks_gen.py