Skip to content

Commit d63955f

Browse files
authored
Add pytype linting to CI (#651)
1 parent 893b984 commit d63955f

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
python-version: 3.8
1919
- name: Install Lint Dependencies
2020
run: |
21-
pip install pyflakes==2.3.0 black==20.8b1 --no-cache-dir
21+
pip install pyflakes==2.3.0 black==20.8b1 pytype==2021.5.25 --no-cache-dir
2222
sudo wget -O /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/4.0.1/buildifier-linux-amd64
2323
sudo chmod +x /usr/local/bin/buildifier
2424
- name: Run PyFlakes
@@ -31,3 +31,5 @@ jobs:
3131
clangFormatVersion: 12
3232
- name: Lint bazel files
3333
run: buildifier -mode=check -r ./
34+
- name: Type check with PyType
35+
run: pytype --jobs auto

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.pytype
12
.lce_configure.bazelrc
23
.DS_Store
34
.ipynb_checkpoints

setup.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[pytype]
2+
3+
inputs = larq_compute_engine
4+
# Keep going past errors to analyse as many files as possible.
5+
keep_going = True
6+
# Don't check use of imported modules, because we have no type-stubs for TF.
7+
strict_import = True
8+
# Disable import errors since our pybind modules are not available during type check and we don't supply type stubs
9+
disable = import-error
10+
python_version = 3.8

0 commit comments

Comments
 (0)