Skip to content
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

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Sep 24, 2021

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:

mypy.....................................................................Failed
- hook id: mypy
- exit code: 2
python/cudf/cudf/tests/conftest.py: error: Duplicate module named "conftest" (also at "python/cudf/cudf/benchmarks/conftest.py")
python/cudf/cudf/tests/conftest.py: note: Are you missing an __init__.py? Alternatively, consider using --exclude to avoid checking one of them.
Found 1 error in 1 file (errors prevented further checking)

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.

@bdice bdice added 3 - Ready for Review Ready for review by team Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function labels Sep 24, 2021
@bdice bdice requested review from shwina and vyasr September 24, 2021 17:58
@github-actions github-actions bot removed the Python Affects Python cuDF API. label Sep 24, 2021
@bdice bdice added the non-breaking Non-breaking change label Sep 24, 2021
@bdice bdice self-assigned this Sep 24, 2021
@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

Merging #9300 (cbd0765) into branch-21.12 (ab4bfaa) will increase coverage by 0.04%.
The diff coverage is 0.00%.

❗ Current head cbd0765 differs from pull request most recent head da6fc43. Consider uploading reports for the commit da6fc43 to get more accurate results
Impacted file tree graph

@@               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     
Impacted Files Coverage Δ
python/cudf/cudf/core/series.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/orc.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/hdf.py 0.00% <0.00%> (ø)
python/cudf/cudf/_version.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/abc.py 0.00% <0.00%> (ø)
python/cudf/cudf/api/types.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/dlpack.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/index.py 0.00% <0.00%> (ø)
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2718443...da6fc43. Read the comment docs.

@shwina
Copy link
Contributor

shwina commented Sep 24, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 165cdac into rapidsai:branch-21.12 Sep 24, 2021
@bdice bdice deleted the pin-mypy branch September 29, 2021 18:14
rapids-bot bot pushed a commit that referenced this pull request Sep 30, 2021
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
rapids-bot bot pushed a commit that referenced this pull request Oct 15, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants