aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormakslevental <maksim.levental@gmail.com>2026-03-15 11:04:59 -0700
committermakslevental <maksim.levental@gmail.com>2026-03-15 11:34:58 -0700
commit8906bade12a1d63a3680487d2e7923c6130f1448 (patch)
tree9d1e3bcbd21457af0aa1808641d747ecb2c9f677
parentd2ffc11f6b50da9aae510ff0712bd351ea3f4577 (diff)
downloadllvm-users/makslevental/pyrefly.tar.gz
llvm-users/makslevental/pyrefly.tar.bz2
llvm-users/makslevental/pyrefly.zip
[MLIR][Python] add pyrefly lit testusers/makslevental/pyrefly
-rw-r--r--.ci/all_requirements.txt11
-rw-r--r--mlir/python/pyrefly.toml4
-rw-r--r--mlir/python/requirements.txt2
-rw-r--r--mlir/test/lit.cfg.py4
-rw-r--r--mlir/test/python/type_check.py1
5 files changed, 22 insertions, 0 deletions
diff --git a/.ci/all_requirements.txt b/.ci/all_requirements.txt
index 32c1f43b7f9a..ee92244e4b03 100644
--- a/.ci/all_requirements.txt
+++ b/.ci/all_requirements.txt
@@ -484,6 +484,17 @@ pynacl==1.6.0 \
--hash=sha256:f46386c24a65383a9081d68e9c2de909b1834ec74ff3013271f1bca9c2d233eb \
--hash=sha256:f4b3824920e206b4f52abd7de621ea7a44fd3cb5c8daceb7c3612345dfc54f2e
# via pygithub
+pyrefly==0.56.0 \
+ --hash=sha256:1e5f53781875024086a5b9f31a89c57d2977487fc3f819d9255008ad34b86fe2 \
+ --hash=sha256:21f018f47debc0842b2c3072201e53c138ae32bcda4f3119bfc8d23f59c16b3e \
+ --hash=sha256:4683f5e8820d5fbfb84231b643b2c5f6cd40b982cac48ef756d4e3d9b09a39cc \
+ --hash=sha256:5478229b09f4bba5bfea000b5ba20ea405f62dc7619ea81197e7ea637d6cba8d \
+ --hash=sha256:95366056ceb224571b9f1c20e801d949f2c1fa2cf4ed6ceaadf85ca2ebe6fb27 \
+ --hash=sha256:ec6ab3f9e2c03bae8dfa520f52778f47b6762020929a664177d36aa3b941db22 \
+ --hash=sha256:f0440a4bbf119ab646468f360e0bd047df051352db1e5d5b9fd58f89e8458809 \
+ --hash=sha256:f4948021639288b1ccda5f124c9562dc7f0a2679111eb314fa266c7bfd9f8603 \
+ --hash=sha256:f84d21d9b9b58481eea02204e2f73cabb93751b21ab2cd99178b4bde24be6a82
+ # via -r mlir/python/requirements.txt
pyyaml==6.0.1 \
--hash=sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5 \
--hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \
diff --git a/mlir/python/pyrefly.toml b/mlir/python/pyrefly.toml
new file mode 100644
index 000000000000..013b8f69ccb9
--- /dev/null
+++ b/mlir/python/pyrefly.toml
@@ -0,0 +1,4 @@
+project-includes = [
+ "**/*.py*",
+ "**/*.ipynb",
+]
diff --git a/mlir/python/requirements.txt b/mlir/python/requirements.txt
index d7b89d5ce6b9..a52475faf56f 100644
--- a/mlir/python/requirements.txt
+++ b/mlir/python/requirements.txt
@@ -6,3 +6,5 @@ typing_extensions>=4.12.2
numpy>=1.19.5, <=2.1.2
ml_dtypes>=0.1.0, <=0.6.0; python_version<"3.13" # provides several NumPy dtype extensions, including the bf16
ml_dtypes>=0.5.0, <=0.6.0; python_version>="3.13"
+# TEST dependencies
+pyrefly==0.56.0
diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py
index a716ba0adb48..4bfae6ecf45c 100644
--- a/mlir/test/lit.cfg.py
+++ b/mlir/test/lit.cfg.py
@@ -340,6 +340,9 @@ config.environment["FILECHECK_OPTS"] = "-enable-var-scope --allow-unused-prefixe
# by copying/linking sources to build.
if config.enable_bindings_python:
config.environment["PYTHONPATH"] = os.getenv("MLIR_LIT_PYTHONPATH", "")
+ config.substitutions.append(
+ ("%mlir_python_src_root", os.path.join(config.mlir_src_root, "python"))
+ )
llvm_config.with_environment(
"PYTHONPATH",
[
@@ -360,6 +363,7 @@ if config.enable_python_stable_abi:
if config.expensive_checks:
config.available_features.add("expensive_checks")
+
def have_host_jit_feature_support(feature_name):
mlir_runner_exe = lit.util.which("mlir-runner", config.mlir_tools_dir)
diff --git a/mlir/test/python/type_check.py b/mlir/test/python/type_check.py
new file mode 100644
index 000000000000..0068c5feed12
--- /dev/null
+++ b/mlir/test/python/type_check.py
@@ -0,0 +1 @@
+# RUN: %PYTHON -m pyrefly check --summarize-errors %mlir_python_src_root | FileCheck %s