PREUPLOAD.cfg: Add vendored packages to mypy

Adjust the PREUPLOAD.cfg to add the vendored python packages to the
mypy and pylint invocations to make sure the preupload hooks pass.

Bug: 259511922
Change-Id: Ie8209352cc523246a767bd52bf23ae909a819ce4
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index 565e2cd..7ec72af 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -9,7 +9,7 @@
 # propagate status codes from the -execXXX family of arguments so we use xargs
 # instead. We also cannot use pipes directly in a hook script so we wrap
 # everything inside a shell command (`sh -c`).
-mypy = sh -c "find . -name '*.py' | xargs -I{} mypy {}"
+mypy = sh -c "find . -name '*.py' | MYPYPATH=${REPO_ROOT}/external/python/markupsafe/src:${REPO_ROOT}/external/python/jinja/src:${REPO_ROOT}/prebuilts/libprotobuf/python xargs -I{} mypy --follow-imports=silent {}"
 
 [Builtin Hooks]
 clang_format = true
@@ -21,3 +21,4 @@
 [Builtin Hooks Options]
 clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
 rustfmt = --config-path=rustfmt.toml
+pylint3 = --disable=no-member,no-name-in-module --init-hook "import sys, os; sys.path.append('${REPO_ROOT}/prebuilts/libprotobuf/python'); sys.path.append('${REPO_ROOT}/external/python/jinja/src')" ${PREUPLOAD_FILES}