-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pin mypy in .pre-commit-config.yaml to match conda environment pinning. #9300
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-21.12 #9300 +/- ##
================================================
+ Coverage 10.79% 10.83% +0.04%
================================================
Files 116 116
Lines 18869 19255 +386
================================================
+ Hits 2036 2087 +51
- Misses 16833 17168 +335
Continue to review full report at Codecov.
|
@gpucibot merge |
I made a small mistake in PR #9300. I missed the setting `pass_filenames: false`, which causes mypy to fail with an error about duplicate module names. This PR adds that setting back and fixes the error. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: #9349
Following up on #9412, this PR updates some pre-commit hook URLs that have moved. This now uses the canonical URLs instead of a redirect. Note: As of PR #9412, the pre-commit configuration is used for style checks on CI. The versions used by pre-commit are in a separate virtual environment from any linters/formatters in the user's local/conda environment. I also updated the pinned versions of `flake8`, `pydocstyle`, and `isort`, which are more than a year old. The updates to these hooks do not require any changes to the code for compliance, and I do not anticipate any PR conflicts. Users of pre-commit will be automatically upgraded next time pre-commit runs. I did not upgrade `black` or `mypy`: - Upgrading `black` to the latest version introduces a relatively large number of small formatting changes and should be handled in a separate PR. - Upgrading `mypy` to the latest version introduces an issue I reported in #9300 and should be handled in a separate PR. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) - Ashwin Srinath (https://github.com/shwina) URL: #9433
Currently mypy set as is a "local" hook in pre-commit, meaning that it uses
mypy
from the user's environment. I have mypy 0.910 installed (released Jun 22, 2021) locally and it fails with the following error:The conda environment pinning is currently 0.782 (released Jun 23, 2020). Newer versions of mypy (around 0.900) have substantial behavior changes, so my newer version throws errors that are not seen in the older mypy that is pinned for CI checks.
This PR changes the behavior of
.pre-commit-config.yml
to use mypy from a mirror repository, at the same pinning used in the conda environment, instead of the local executable.