Skip to content

Commit

Permalink
ci: run pyright as part of CI
Browse files Browse the repository at this point in the history
Signed-off-by: Ingo Müller <[email protected]>
  • Loading branch information
ingomueller-net committed Nov 28, 2024
1 parent 0502182 commit 04b8fe2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,11 @@ jobs:
- name: Run lit tests
run: |
cmake --build ${SUBSTRAIT_MLIR_MAIN_BINARY_DIR} --target check-substrait-mlir
# Run this as part of the `build` job because we need the `build` folder.
- name: Run pyright to test if typing annotations are correct
uses: jakebailey/pyright-action@v2
with:
stats: true
working-directory: substrait-mlir
project: pyproject.toml
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.pyright]

# Point `pyright` to the built files rather than those in the source tree
# because relative imports won't work in the latter case. (They work in the
# former because the build process copies files from several places.)
include = [
'test/python/',
'build/tools/substrait_mlir/python_packages/substrait_mlir/dialects/substrait.py',
'build/tools/substrait_mlir/python_packages/substrait_mlir/_mlir_libs/_substraitDialects/',
]

exclude = [
'**/lit.cfg.py',
]

extraPaths = [
'build/tools/mlir/python_packages/',
'build/tools/substrait_mlir/python_packages/',
]

0 comments on commit 04b8fe2

Please sign in to comment.