From 11fa554cb801538155212dd71211bda1f8359f86 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 27 Jan 2025 14:13:18 -0600 Subject: [PATCH 1/2] add pre-commit (#741) Proposes adding a small `pre-commit` configuration to the repo, and a new CI job that runs it. Motivated by noticing an unused import in this Python code: https://github.com/rapidsai/integration/blob/172ef624ea50670969e1fd79930a46eabdd9c3c9/ci/check_conda_nightly_env.py#L3 I think this will be helpful to catch the types of things that static analyzers are good at catching. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Gil Forsyth (https://github.com/gforsyth) URL: https://github.com/rapidsai/integration/pull/741 --- .github/workflows/pr.yaml | 9 +++++++++ .pre-commit-config.yaml | 20 ++++++++++++++++++++ ci/check_conda_nightly_env.py | 4 ++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1157333a..52ef30e3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -16,12 +16,21 @@ jobs: - test-conda-nightly-env secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-25.02 + checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - uses: pre-commit/action@v3.0.1 build: + needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-25.02 with: build_type: pull-request test-conda-nightly-env: + needs: checks secrets: inherit # We use a build workflow so that we get CPU jobs and high matrix coverage uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-25.02 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..833cc091 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +--- +# Copyright (c) 2025, NVIDIA CORPORATION. + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: end-of-file-fixer + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.9.3 + hooks: + - id: ruff + args: ["--fix"] + - id: ruff-format + - repo: https://github.com/rapidsai/pre-commit-hooks + rev: v0.5.0 + hooks: + - id: verify-copyright diff --git a/ci/check_conda_nightly_env.py b/ci/check_conda_nightly_env.py index 32bf4fae..172ce78e 100644 --- a/ci/check_conda_nightly_env.py +++ b/ci/check_conda_nightly_env.py @@ -1,6 +1,6 @@ +# Copyright (c) 2024-2025, NVIDIA CORPORATION. import json import re -import subprocess import sys from datetime import datetime, timedelta @@ -139,7 +139,7 @@ def check_env(json_path): if __name__ == "__main__": if len(sys.argv) != 2: - print("Provide only one argument, the filepath to a JSON output from " "conda.") + print("Provide only one argument, the filepath to a JSON output from conda.") sys.exit(1) sys.exit(check_env(sys.argv[1])) From 057e3711a3a2fb7bed705bdfeaff549328f346f6 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 28 Jan 2025 13:17:16 -0600 Subject: [PATCH 2/2] test-conda-nightly-env: remove ucx-proc exclusion (#742) Contributes to https://github.com/rapidsai/build-planning/issues/142 Proposes removing the exclusion for `ucx-proc` in the CI job that checks that all projects have produced recent-enough nightlies. See that linked issue for much more detail, but in short: * there haven't been new `ucx-proc` packages for 2+ years, since https://github.com/conda-forge/ucx-split-feedstock/pull/111 * RAPIDS can safely drop its `ucx-proc` dependency, and other PRs linked to https://github.com/rapidsai/build-planning/issues/142 have done that for the 25.02 release * `ucx-proc` should not show up in RAPIDS 25.02 environment solves, and so we don't need to carry an exclusion for it in the testing config Authors: - James Lamb (https://github.com/jameslamb) Approvers: - https://github.com/jakirkham - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/integration/pull/742 --- ci/check_conda_nightly_env.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/check_conda_nightly_env.py b/ci/check_conda_nightly_env.py index 172ce78e..1d573f48 100644 --- a/ci/check_conda_nightly_env.py +++ b/ci/check_conda_nightly_env.py @@ -18,8 +18,6 @@ "libxgboost", "py-xgboost", "xgboost", - # TODO: Do we want ucx-proc on rapidsai or from conda-forge? - "ucx-proc", } # ANSI color codes used to highlight lines