Closed jameslamb closed 2 months ago
@trivialfis did this for a reason - maybe he can explain why.
The pre-commit hook runs in an isolated environment, which doesn't include legate and other dependencies. As a result, the type checking is not rigorous.
The pre-commit hook runs in an isolated environment, which doesn't include legate and other dependencies. As a result, the type checking is not rigorous.
Blegh you're right, I misunderstood how the isolation for mypy
worked. We could get pretty good coverage of most dependencies by adding them to the additional_dependencies
list that pre-commit
provides... but not legate-core
or cunumeric
, because they don't publish wheels today.
We can close this, sorry for the noise and thanks for correcting my understanding.
Just had a quick read about this issue: https://tech.quantco.com/blog/conda-in-pre-commit
Looks like it is possible now with (too much) effort to use a conda environment with pre-commit. Maybe in the future this will be easier.
ooo very interesting, hadn't seen that! Thanks for sharing.
Contributes to #115.
Proposes running
mypy
viapre-commit
, for the following reasons:mypy
configuration[test]
extra for the packagemypy
version across all the place where those checks are run (to limit "it works on my computer, why is CI broken" types of situations)As part of this, this PR also proposes running
pre-commit
checks in CI before the other building and testing, on a standard GitHub-hostedubuntu-latest
runner, to avoid occupying an NVIDIA-hosted GPU runner for a build that's doomed to fail because of linter errors.Notes for Reviewers
Running these checks in the
rapidsai/ci-conda:latest
image and via a script namedci/check_style.sh
mirrors what is done across most RAPIDS libraries. That'll make it easier to continue integrating CI tools from RAPIDS.