Skip to content

Commit

Permalink
update all pre-commit hooks (#36)
Browse files Browse the repository at this point in the history
Working on #35, I noticed that some of the `pre-commit` hooks here were
fairly old.

This updates all of them, to pull in bugfixes and improvements.
  • Loading branch information
jameslamb authored Jan 3, 2025

Verified

This commit was signed with the committer’s verified signature.
legendecas Chengzhong Wu
1 parent 6e4e64c commit 9a7a26d
Showing 3 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: |
@@ -15,7 +15,7 @@ repos:
rapids-metadata[.]json$|
schemas/rapids-metadata-v[0-9]+[.]json$
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.13.11
rev: v1.17.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
@@ -24,7 +24,7 @@ repos:
hooks:
- id: codespell
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
rev: v0.8.5
hooks:
- id: ruff
args: ["--fix"]
@@ -35,7 +35,7 @@ repos:
- id: verify-copyright
args: [--fix, --main-branch=main]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0'
rev: 'v1.14.1'
hooks:
- id: mypy
args: [
7 changes: 2 additions & 5 deletions src/rapids_metadata/metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, NVIDIA CORPORATION.
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -30,10 +30,7 @@

@dataclass
class RAPIDSPackage:
(
"""Package published by a RAPIDS repository. Includes both Python packages """
"""and Conda packages."""
)
"""Package published by a RAPIDS repository. Includes both Python packages and Conda packages."""

publishes_prereleases: bool = Field(
default=True,
18 changes: 12 additions & 6 deletions tests/test_json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, NVIDIA CORPORATION.
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -351,8 +351,10 @@ def check_output(output: str):
else:
assert output == expected_json

with set_cwd(tmp_path), patch("sys.argv", ["rapids-metadata-json", *args]), patch(
"rapids_metadata.json.all_metadata", mock_metadata
with (
set_cwd(tmp_path),
patch("sys.argv", ["rapids-metadata-json", *args]),
patch("rapids_metadata.json.all_metadata", mock_metadata),
):
rapids_json.main()
captured = capsys.readouterr()
@@ -363,9 +365,13 @@ def check_output(output: str):
captured = capsys.readouterr()
check_output(captured.out)

with set_cwd(tmp_path), patch(
"sys.argv", ["rapids-metadata-json", *args, "-o", "rapids-metadata.json"]
), patch("rapids_metadata.json.all_metadata", mock_metadata):
with (
set_cwd(tmp_path),
patch(
"sys.argv", ["rapids-metadata-json", *args, "-o", "rapids-metadata.json"]
),
patch("rapids_metadata.json.all_metadata", mock_metadata),
):
rapids_json.main()
with open("rapids-metadata.json") as f:
written_json = f.read()

0 comments on commit 9a7a26d

Please sign in to comment.