Repository navigation
Add a tox environment for running mypy - #2431
Merged
Merged
Conversation
namurphy
commented
Dec 29, 2023
Comment on lines
-85
to
-97
| # Some of these packages contain typing information for packages that | ||
| # don't themselves contain type hints. We might want to move these from | ||
| # the tests section and into the specific mypy environment. | ||
| tests = [ | ||
| "hypothesis >= 6.35.1", | ||
| "pandas-stubs >= 1.5.0.221010", # used by mypy | ||
| "pre-commit >= 3.0.0", | ||
| "pytest-regressions >= 2.3.1", | ||
| "pytest-xdist >= 3.0.2", | ||
| "tomli >= 2.0.1", | ||
| "tox >= 4.3.1", | ||
| "types-requests >= 2.27.1", # used by mypy | ||
| "types-tqdm >= 4.66.0.3", # used by mypy |
Member
Author
There was a problem hiding this comment.
Turns out that the type stub packages can be installed using the --install-types flag for mypy, so they're not needed here. Using that flag has the advantage that it'll probably get updated with type stub packages as more are created or obsoleted, which means less work for us to do!
namurphy
commented
Dec 29, 2023
| deps = | ||
| mypy >= 1.8.0 | ||
| commands = | ||
| mypy plasmapy --install-types --non-interactive --show-error-context --show-error-code-links --pretty |
Member
Author
There was a problem hiding this comment.
We'll probably want to play with these flags to get the error reporting settings that work best for us.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2431 +/- ##
=======================================
Coverage 96.92% 96.92%
=======================================
Files 104 104
Lines 9128 9128
=======================================
Hits 8847 8847
Misses 281 281 ☔ View full report in Codecov by Sentry. |
6 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a tox environment for running the mypy static type checking tool. This tox environment will be added to our suite of continuous integration tests in #2432.
I am separating this PR out and merging it so that I can use this tox environment in other PRs, like #2429.
Related to #268. The motivation for using mypy is discussed in #2424.