-
Notifications
You must be signed in to change notification settings - Fork 919
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
Update to mypy 0.971 #11640
Update to mypy 0.971 #11640
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll also want to update the conda environment:
- mypy=0.782 |
I expect this may cause compatibility issues and require a broader update of mypy across RAPIDS. Alternatively, we can remove mypy from the conda environment (so it can't conflict with other RAPIDS envs) and solely rely on pre-commit for managing the version and executing the check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a surprisingly minimal changeset. I thought the update required more changes than this, but perhaps that was due to unrelated incompatibilities? If CI passes then that's good enough for me.
I believe cudf is the only package in RAPIDS that uses mypy at all, so it shouldn't cause any problems (unless there are incompatibilities with dependencies). |
1e2cc5a
to
5c0ab18
Compare
Avoids need to explicit-package-bases
6a2cdd5
to
d534174
Compare
@wence- Before merging, can you please write a PR description describing the motivation for this change and the scope of the changes? (Ideally we would use the PR template checklist, too.) |
Done. |
Co-authored-by: Bradley Dice <[email protected]>
Final question to address is what we want to do about missing imports in the pre-commit environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also need to be updated in the integration
repository below. Can you update the mypy
version and add the types-cachetools
package to the rapids-build-env
package?
@ajschmidt8 @wence- @vyasr Longer term, as the integration repo is phased out, we may not want to keep “developer tools” like mypy, flake8, black in the conda environment if they are being managed by pre-commit for a given repo. Users wanting consistency with CI style checks must run mypy through pre-commit and not as a standalone executable from the conda environment. There’s not much reason to keep mypy in the conda environment unless it helps developers’ IDE settings, but the results will not necessarily be consistent with what pre-commit’s mypy expects. The pre-commit environment is ultimately our source of truth for CI and local pre-commit checks. |
@bdice, so pre-commit is also used in CI? If that's the case, then I'm fine with either of the following:
Based on your comment, it seems like it never really needed to be in the |
@ajschmidt8 We used the integration repo's copy of Line 23 in 66b5a0c
To my knowledge, the only reason we should keep those tools in the cuDF environment is for developers who want IDE integration (usually for VS Code) with If no developers want it installed in the development environment for purposes of IDE integration, it would be safe to remove from the cuDF conda environment file. Same for other "developer" tools like |
@bdice, got it. we can remove those packages from |
I'm 100% in favor of that path. Just wanted to clarify that the integration |
I'm fine with the path outlined above. I agree that we can remove linters from the environment in the long run and just relyin on pre-commit, and I'm also happy to let this happen organically as integration is phased out rather than trying to be proactive in simplifying a repo that is going away anyway. Also, to answer the question about who uses which linters, AFAIK cudf is the only RAPIDS library using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay in re-reviewing this. Looks mostly fine, there are a couple of minor questions I have left then we should be good to go.
Done here: rapidsai/integration#531 |
Update mypy version in build env in line with rapidsai/cudf#11640
@gpucibot merge |
As part of #11640, there was a missing exclusion for `cudf/cudf/utils/metadata/orc_column_statistics_pb2.py`, that causes the following errors: ```bash (cudfdev) pgali@dt07:/nvme/0/pgali/cudf$ git commit -m "address reviews" [WARNING] Unstaged files detected. [INFO] Stashing unstaged files to /home/nfs/pgali/.cache/pre-commit/patch1662993629-63423. isort....................................................................Passed black....................................................................Passed flake8...................................................................Passed mypy.....................................................................Failed - hook id: mypy - exit code: 1 python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:7: error: Library stubs not installed for "google.protobuf.internal" (or incompatible with Python 3.9) python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:7: note: Hint: "python3 -m pip install types-protobuf" python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:7: note: (or run "mypy --install-types" to install all missing stub packages) python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:7: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:8: error: Library stubs not installed for "google.protobuf" (or incompatible with Python 3.9) python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:25: error: Name "_BUCKETSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:26: error: Name "_BUCKETSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:27: error: Name "_INTEGERSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:28: error: Name "_INTEGERSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:29: error: Name "_DOUBLESTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:30: error: Name "_DOUBLESTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:31: error: Name "_STRINGSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:32: error: Name "_STRINGSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:33: error: Name "_BUCKETSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:34: error: Name "_BUCKETSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:35: error: Name "_DECIMALSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:36: error: Name "_DECIMALSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:37: error: Name "_DATESTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:38: error: Name "_DATESTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:39: error: Name "_TIMESTAMPSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:40: error: Name "_TIMESTAMPSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:41: error: Name "_BINARYSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:42: error: Name "_BINARYSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:43: error: Name "_COLUMNSTATISTICS" is not defined python/cudf/cudf/utils/metadata/orc_column_statistics_pb2.py:44: error: Name "_COLUMNSTATISTICS" is not defined Found 22 errors in 1 file (checked 138 source files) pydocstyle...............................................................Passed clang-format.........................................(no files to check)Skipped no-deprecationwarning....................................................Passed cmake-format.........................................(no files to check)Skipped - hook id: cmake-format cmake-lint...........................................(no files to check)Skipped - hook id: cmake-lint copyright-check..........................................................Passed doxygen-check........................................(no files to check)Skipped - hook id: doxygen-check [INFO] Restored changes from /home/nfs/pgali/.cache/pre-commit/patch1662993629-63423. ``` Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Lawrence Mitchell (https://github.com/wence-) URL: #11685
Description
Update to current mypy, primarily since on Apple silicon, the previous pinned version of mypy is no longer installable (
typed-ast
does not build from source). This necessitates some minor updates to the type annotation rules, since the newer mypy version is a bit pickier.While we're here, exclude directories we were previously just ignoring errors in.
Checklist