Skip to content

Commit

Permalink
update pre-commit hooks (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Jun 7, 2024
1 parent c6ef8cf commit 920e8eb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/checks-and-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
run: "./ci/check_style.sh"
build-conda:
needs: check-style
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.06
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08
with:
build_type: ${{ inputs.build_type }}
script: "ci/build_python.sh"
# Select only the build with the minimum Python version and the maximum CUDA version
matrix_filter: '[map(select(.ARCH == "amd64")) | min_by((.PY_VER | split(".") | map(tonumber)), (.CUDA_VER | split(".") | map(-tonumber)))]'
build-wheel:
needs: check-style
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.06
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08
with:
build_type: ${{ inputs.build_type }}
script: "ci/build_wheel.sh"
Expand All @@ -40,7 +40,7 @@ jobs:
needs:
- build-wheel
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.06
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.08
with:
build_type: ${{ inputs.build_type }}
package-name: rapids-build-backend
Expand All @@ -49,7 +49,7 @@ jobs:
needs:
- build-conda
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.06
uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.08
with:
build_type: ${{ inputs.build_type }}
if: ${{ inputs.publish }}
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.10.0
rev: v1.13.11
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
rev: v0.4.8
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v0.0.3
rev: v0.1.0
hooks:
- id: verify-copyright
args: [--fix, --main-branch=main]
Expand Down
13 changes: 10 additions & 3 deletions tests/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,14 @@ def test_simple_scikit_build_core(tmp_path, env, nvcc_version):
"cu12": ["cupy-cuda12x>=12.0.0"],
},
"extras": {"jit": {"cu11": ["ptxcompiler-cu11"]}},
# having multiple >= constraints is weird, but it's here to avoid
# https://github.com/rapidsai/rapids-build-backend/pull/40#issuecomment-2152949912
# (by always pulling from from pypi.anaconda.org/rapidsai-wheels-nightly)
# while still testing that rapids-build-backend preserves all the dependency
# specifiers
"build_requires": {
"cu11": ["rmm-cu11==24.4.*,>=0.0.0a0"],
"cu12": ["rmm-cu12==24.4.*,>=0.0.0a0"],
"cu11": ["rmm-cu11>=24.4.0,>=0.0.0a0"],
"cu12": ["rmm-cu12>=24.4.0,>=0.0.0a0"],
},
"build_backend": "scikit_build_core.build",
"build_backend_package": "scikit-build-core",
Expand All @@ -109,7 +114,9 @@ def test_simple_scikit_build_core(tmp_path, env, nvcc_version):
name, build_requires, requirements, extras = _generate_wheel(env, package_dir)

assert name == f"simple_scikit_build_core-cu{nvcc_version}"
assert {f"rmm-cu{nvcc_version}==24.4.*,>=0.0.0a0"}.issubset(build_requires)
# note: this is also testing that the dependency specifiers were rearranged
# (i.e. that >=0.0.0a0 comes before >=24.4.0)
assert {f"rmm-cu{nvcc_version}>=0.0.0a0,>=24.4.0"}.issubset(build_requires)
assert requirements == {f"cupy-cuda{nvcc_version}x>=12.0.0"}
if nvcc_version == "11":
assert extras == {"jit": {"ptxcompiler-cu11"}}
Expand Down

0 comments on commit 920e8eb

Please sign in to comment.