Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
language: python
files: (^|/)dependencies[.]yaml$
args: [--fix]
additional_dependencies:
- --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple
- .[dependencies]
- id: verify-hardcoded-version
name: verify-hardcoded-version
description: make sure RAPIDS version is not hard-coded in files
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ test = [
"pre-commit",
"pytest",
"rapids-pre-commit-hooks[alpha-spec]",
"rapids-pre-commit-hooks[dependencies]",
]
alpha-spec = [
"rapids-metadata>=0.4.0,<0.5.0.dev0",
]
dependencies = [
"rapids-metadata>=0.4.0,<0.5.0.dev0",
]

[project.scripts]
verify-alpha-spec = "rapids_pre_commit_hooks.alpha_spec:main"
Expand Down
13 changes: 13 additions & 0 deletions src/rapids_pre_commit_hooks/dependencies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import argparse

from .cuda_suffixed import CUDASuffixedHandler
from .use_cuda_wheels import UseCUDAWheelsHandler
from ..lint import Linter, LintMain
from ..utils.dependencies_yaml import (
Expand All @@ -13,6 +14,7 @@

def check_dependencies(linter: "Linter", args: "argparse.Namespace") -> None:
handler = ChainedHandler()
handler.add_handler(CUDASuffixedHandler(linter, args))
handler.add_handler(UseCUDAWheelsHandler(linter, args))
traverse_dependencies_yaml(handler, linter.content)

Expand All @@ -22,6 +24,17 @@ def main() -> None:
m.argparser.description = (
"Verify that dependencies.yaml follows the correct conventions."
)
m.argparser.add_argument(
"--rapids-version",
help="Specify a RAPIDS version to use instead of reading from the "
"VERSION file",
)
m.argparser.add_argument(
"--rapids-version-file",
help="Specify a file to read the RAPIDS version from instead of "
"VERSION",
default="VERSION",
)
with m.execute() as ctx:
ctx.add_check(check_dependencies)

Expand Down
Loading
Loading