llvm-project/mlir/test/python/develoment_files.py
Tobias Hieta f9008e6366
[NFC][Py Reformat] Reformat python files in mlir subdir
This is an ongoing series of commits that are reformatting our
Python code.

Reformatting is done with `black`.

If you end up having problems merging this commit because you
have made changes to a python file, the best way to handle that
is to run git checkout --ours <yourfile> and then reformat it
with black.

If you run into any problems, post to discourse about it and
we will try to help.

RFC Thread below:

https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Differential Revision: https://reviews.llvm.org/D150782
2023-05-26 08:05:40 +02:00

20 lines
627 B
Python

# RUN: %PYTHON %s 2>&1
import os
from mlir._mlir_libs import get_include_dirs, get_lib_dirs
header_file = os.path.join(get_include_dirs()[0], "mlir-c", "IR.h")
assert os.path.isfile(header_file), f"Header does not exist: {header_file}"
# Since actual library names are platform specific, just scan the directory
# for a filename that contains the library name.
expected_lib_name = "MLIRPythonCAPI"
all_libs = os.listdir(get_lib_dirs()[0])
found_lib = False
for file_name in all_libs:
if expected_lib_name in file_name:
found_lib = True
assert found_lib, f"Did not find '{expected_lib_name}' lib in {all_libs}"