summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2021-11-17 21:12:56 -0800
committerGitHub <noreply@github.com>2021-11-17 21:12:56 -0800
commit00c261f951ae6734001e0419d2bc754eef6dd1b2 (patch)
tree54e6ce86c89f3de9f2d960f4726025487216d3c8 /.github
parent4ebdb5e2ca6c6a1f9fb3bf8c2279f9b857c6d8a7 (diff)
downloadnetworkx-00c261f951ae6734001e0419d2bc754eef6dd1b2.tar.gz
Add Mypy type checking infrastructure (#5127)
* Add minimal mypy configuration file. * Add mypy workflow to GH. * Properly import sentinels from traversal.edgedfs. * mypy doesn't like variables named \"e\". * Rm annotations from single function. * Fix name collisions in test suite. Make sure all tests have unique names. * Rm unused random seed in test setup. * Rm redundant __all__ specification. * Silence mypy error from sum(). Mypy bug? * Fix tsp test instantiation nit. * \"type: ignore\" to suppress conditional fn sigature errors. * Remaining \"type: ignore\" to appease mypy. * Configure mypy to ignore inheritance issues. * Update exclude conf for CI. - Add yaml - Reformat regex containing reportviews * Rm partial annotations from lukes.py. Fixes mypy errors due to unannotated code. * Reorg defaultdict to reduce type: ignore cruft. * Homogenize signatures for fns defined in conditionals. * err as varname only in exception catching. * Fix name collision in Bellman-Ford test suite.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/mypy.yml30
1 files changed, 30 insertions, 0 deletions
diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml
new file mode 100644
index 00000000..4fb47ba8
--- /dev/null
+++ b/.github/workflows/mypy.yml
@@ -0,0 +1,30 @@
+name: Mypy
+
+on: [push, pull_request]
+
+jobs:
+ type-check:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: [3.9]
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install packages
+ run: |
+ pip install --upgrade pip wheel setuptools
+ pip install -r requirements/developer.txt
+ # Rm below when yaml no longer a dep
+ pip install types-PyYAML
+ pip install -e .
+ pip list
+
+ - name: run mypy
+ run: mypy -p networkx