-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1244: Add type checking (mypy)
- Loading branch information
Showing
14 changed files
with
115 additions
and
10 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
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
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
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
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
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
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
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
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
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
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,49 @@ | ||
[mypy] | ||
# Don't set python_version. Instead, use the default behavior of checking for | ||
# compatibility against the version of Python used to run mypy. | ||
files = augur/ | ||
|
||
# Require functions with an annotated return type to be explicit about | ||
# potentially returning None (via Optional[…]). | ||
strict_optional = False | ||
|
||
# In the future maybe we can contribute typing stubs for these modules (either | ||
# complete stubs in the python/typeshed repo or partial stubs just in | ||
# this repo), but for now that's more work than we want to invest. These | ||
# sections let us ignore missing stubs for specific modules without hiding all | ||
# missing errors like (--ignore-missing-imports). | ||
[mypy-treetime.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-isodate.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-Bio.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-BCBio.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-matplotlib.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-seaborn.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-cvxopt.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-ipdb.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-jsonschema.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-pyfastx.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-networkx.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-scipy.*] | ||
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
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
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,9 @@ | ||
from pathlib import Path | ||
from subprocess import run | ||
|
||
topdir = Path(__file__).resolve().parent.parent | ||
|
||
def test_mypy(): | ||
# Check the exit status ourselves for nicer test output on failure | ||
result = run(["mypy"], cwd = topdir) | ||
assert result.returncode == 0, "mypy exited with errors" |