forked from Adversarial-Deep-Learning/code-soup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add static type checking using mypy (Adversarial-Deep-Learning#86)
Co-authored-by: Somesh Kumar Singh <f20180175@goa.bits-pilani.ac.in>
- Loading branch information
1 parent
0257efa
commit 191a0a9
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Static Typing | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
typing: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8] | ||
|
||
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 dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Enforce typing | ||
run: | | ||
mypy --config-file mypy.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[mypy] | ||
files = code_soup | ||
pretty = True | ||
show_error_codes = True | ||
|
||
check_untyped_defs = True | ||
disallow_incomplete_defs = True | ||
disallow_subclassing_any = True | ||
disallow_untyped_decorators = True | ||
disallow_untyped_defs = True | ||
no_implicit_optional = True | ||
strict_equality = True | ||
warn_redundant_casts = True | ||
warn_unused_configs = True | ||
warn_unused_ignores = True | ||
|
||
[mypy-numpy.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-torchvision.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-scipy.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-cv2.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-PIL.*] | ||
ignore_missing_imports = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ torchvision==0.10.0 | |
parameterized==0.8.1 | ||
scipy==1.6.2 | ||
opencv-python==4.5.3.56 | ||
mypy==0.910 |