[llvm] e4afffb - [MLGO] Add pytype test (#79558)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 26 12:24:20 PST 2024
Author: Aiden Grossman
Date: 2024-01-26T12:24:15-08:00
New Revision: e4afffbe8cc31278a9006712e7323d49eae9dbb6
URL: https://github.com/llvm/llvm-project/commit/e4afffbe8cc31278a9006712e7323d49eae9dbb6
DIFF: https://github.com/llvm/llvm-project/commit/e4afffbe8cc31278a9006712e7323d49eae9dbb6.diff
LOG: [MLGO] Add pytype test (#79558)
This patch adds a pytype test to the mlgo-utils lit test suite to
prevent regressions in typing while we wait to setup precommit CI for
this specific project.
This is somewhat hacky, but is a temporary fix and will be pulled out
soonish. It also should only impact the ML buildbots as they are the
only ones that should have `pytype` installed.
Added:
llvm/utils/mlgo-utils/mlgo/corpus/__init__.py
llvm/utils/mlgo-utils/tests/pytype.test
Modified:
llvm/utils/mlgo-utils/tests/lit.local.cfg
Removed:
################################################################################
diff --git a/llvm/utils/mlgo-utils/mlgo/corpus/__init__.py b/llvm/utils/mlgo-utils/mlgo/corpus/__init__.py
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/llvm/utils/mlgo-utils/tests/lit.local.cfg b/llvm/utils/mlgo-utils/tests/lit.local.cfg
index a9088750cb58b1..e5cbf03104c489 100644
--- a/llvm/utils/mlgo-utils/tests/lit.local.cfg
+++ b/llvm/utils/mlgo-utils/tests/lit.local.cfg
@@ -4,3 +4,11 @@ import sys
# the entire project has been bumped to 3.8.
if sys.version_info > (3,8):
config.available_features.add("python-38")
+
+# TODO(boomanaiden154): Remove this flag once we enable type checking in the
+# precommit CI.
+try:
+ import pytype
+ config.available_features.add("has-pytype")
+except:
+ pass
diff --git a/llvm/utils/mlgo-utils/tests/pytype.test b/llvm/utils/mlgo-utils/tests/pytype.test
new file mode 100644
index 00000000000000..e2d620472305f1
--- /dev/null
+++ b/llvm/utils/mlgo-utils/tests/pytype.test
@@ -0,0 +1,4 @@
+# REQUIRES: system-linux, has-pytype
+
+# RUN: pytype %S/../mlgo
+# RUN: pytype %S/../tests
More information about the llvm-commits
mailing list