diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..e93ef15 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,36 @@ +name: build + +on: + push: + # run on every new commit pushed to 'main' + branches: + - main + # run whenever a new tag is created following one of the following patterns + tags: + - v[0-9][0-9].[0-9][0-9].[0-9][0-9] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + wheel-build: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.06 + with: + build_type: branch + script: ci/build_wheel.sh + # only need 1 build: amd64, oldest-supported Python, latest-supported CUDA + matrix_filter: '[map(select(.ARCH == "amd64")) | min_by((.PY_VER | split(".") | map(tonumber)), (.CUDA_VER | split(".") | map(-tonumber)))]' + package-name: rapids-cli + package-type: python + pure-wheel: true + append-cuda-suffix: false + wheel-publish: + needs: wheel-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-25.06 + with: + build_type: branch + package-name: rapids-cli + package-type: python diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0e89057..ce95a4e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -17,13 +17,25 @@ jobs: - uses: actions/checkout@v4 - name: Run pre-commit uses: pre-commit/action@v3.0.1 - test: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install dependencies - run: | - pip install -e .[test] - - name: Run tests - run: pytest + build-wheel: + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.06 + needs: [checks] + with: + build_type: pull-request + script: ci/build_wheel.sh + # only need 1 build (pure Python): amd64, oldest-supported Python, latest-supported CUDA is fine + matrix_filter: '[map(select(.ARCH == "amd64")) | min_by((.PY_VER | split(".") | map(tonumber)), (.CUDA_VER | split(".") | map(-tonumber)))]' + package-name: rapids-cli + package-type: python + pure-wheel: true + append-cuda-suffix: false + wheel-tests: + needs: [build-wheel] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-25.06 + with: + build_type: pull-request + node_type: "gpu-l4-latest-1" + arch: "amd64" + container_image: "rapidsai/citestwheel:latest" + run_script: ci/test_wheel.sh diff --git a/.gitignore b/.gitignore index 83c97b5..3e3600b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ +*.bz2 +*.conda .mypy_cache/ .ruff_cache/ +*.tar.gz +*.whl +*.zip # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh new file mode 100755 index 0000000..6bd0dea --- /dev/null +++ b/ci/build_wheel.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Copyright (c) 2024-2025, NVIDIA CORPORATION. + +set -euo pipefail + +python -m pip wheel \ + -v \ + --no-deps \ + --disable-pip-version-check \ + -w "${RAPIDS_WHEEL_BLD_OUTPUT_DIR}" \ + . diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh new file mode 100755 index 0000000..b729091 --- /dev/null +++ b/ci/test_wheel.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# nx-cugraph is a pure wheel, which is part of generating the download path +WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="rapids-cli" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-github python) + +# echo to expand wildcard before adding `[extra]` requires for pip +rapids-pip-retry install \ + "$(echo "${WHEELHOUSE}"/rapids_cli*.whl)[test]" + +python -m pytest diff --git a/pyproject.toml b/pyproject.toml index 8805733..63aa8ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,12 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = [ + "setuptools>=64.0.0", + "wheel", +] build-backend = "setuptools.build_meta" [project] -name = "rapids_cli" +name = "rapids-cli" version = "0.1" description = "A CLI for RAPIDS" requires-python = ">=3.10"