Skip to content

Commit

Permalink
Run mypy in pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleFromNVIDIA committed Aug 23, 2024
1 parent 5d453f2 commit d500506
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
24 changes: 23 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,30 @@ repos:
- id: flake8
args:
- --show-source
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0'
hooks:
- id: mypy
args:
- --config-file=pyproject.toml
- --exclude
- '^test/examples/'
- src/
- test/
pass_filenames: false
additional_dependencies:
- --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple
- bashlex
- freezegun
- gitpython
- packaging
- pytest
- rapids-metadata>=0.3.1
- rich
- tomlkit
- types-PyYAML
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v0.1.0
rev: v0.3.1
hooks:
- id: verify-copyright
files: |
Expand Down
3 changes: 2 additions & 1 deletion src/rapids_pre_commit_hooks/alpha_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import yaml
from packaging.requirements import InvalidRequirement, Requirement
from rapids_metadata.metadata import RAPIDSVersion
from rapids_metadata.remote import fetch_latest

from .lint import LintMain
Expand All @@ -42,7 +43,7 @@ def node_has_type(node, tag_type):
return node.tag == f"tag:yaml.org,2002:{tag_type}"


def get_rapids_version(args: argparse.Namespace) -> str:
def get_rapids_version(args: argparse.Namespace) -> RAPIDSVersion:
md = all_metadata()
return (
md.versions[args.rapids_version]
Expand Down
1 change: 1 addition & 0 deletions src/rapids_pre_commit_hooks/shell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# type: ignore
import bashlex

from ..lint import ExecutionContext, LintMain
Expand Down
1 change: 1 addition & 0 deletions test/rapids_pre_commit_hooks/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# type: ignore
import bashlex

from rapids_pre_commit_hooks.lint import Linter
Expand Down

0 comments on commit d500506

Please sign in to comment.