Skip to content

Commit

Permalink
Type Checking in CI (#3705)
Browse files Browse the repository at this point in the history
* add mypy type hinting machinery and CI testing
  • Loading branch information
umak1106 authored Jun 14, 2022
1 parent ec5da1d commit a2f9e94
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "mypy"
on:
push:
branches:
- develop
pull_request:
branches:
- develop

concurrency:

group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

jobs:
mypy :
if: "github.repository == 'MDAnalysis/mdanalysis'"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
auto-update-conda: true
channel-priority: flexible
channels: conda-forge, bioconda
add-pip-as-python-dependency: true
mamba-version: "*"
architecture: x64

- name: install_deps
uses: ./.github/actions/setup-deps
with:
mamba: true
full-deps: true
numpy: numpy=1.20.0

- name: install
run: |
python -m pip install mypy
- name: "Run mypy"
run: |
mypy package/MDAnalysis/
54 changes: 54 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[mypy]
ignore_missing_imports = True
exclude = doc/sphinx/source/


[mypy-MDAnalysis.analysis.*]
ignore_errors = True

[mypy-MDAnalysis.auxiliary.*]
ignore_errors = True

[mypy-MDAnalysis.converters.*]
ignore_errors = True

[mypy-MDAnalysis.coordinates.*]
ignore_errors = True

[mypy-MDAnalysis.core.*]
ignore_errors = True

[mypy-MDAnalysis.lib.*]
ignore_errors = True

[mypy-MDAnalysis.selections.*]
ignore_errors = True

[mypy-MDAnalysis.tests.*]
ignore_errors = True

[mypy-MDAnalysis.topology.*]
ignore_errors = True

[mypy-MDAnalysis.transformations.*]
ignore_errors = True

[mypy-MDAnalysis.visualization.*]
ignore_errors = True

[mypy-MDAnalysis.due]
ignore_errors = True

[mypy-MDAnalysis.exceptions]
ignore_errors = True

[mypy-MDAnalysis.units]
ignore_errors = True

[mypy-MDAnalysis.version]
ignore_errors = True

[mypy-MDAnalysis.*]
ignore_errors = True


2 changes: 2 additions & 0 deletions mypy_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mypy==0.960
typing_extensions

0 comments on commit a2f9e94

Please sign in to comment.