diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index dbaf18b..e6b6058 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -15,6 +15,14 @@ jobs: - wheel-build secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.04 + conda-python-build: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.04 + with: + build_type: pull-request + # Package is pure Python and only ever requires one build. + # This selects "ARCH=amd64 + the latest supported Python + CUDA". + matrix_filter: map(select(.ARCH == "amd64")) | max_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]) | [.] wheel-build: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.04 diff --git a/ci/build_python.sh b/ci/build_python.sh new file mode 100755 index 0000000..a131eba --- /dev/null +++ b/ci/build_python.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +rapids-configure-conda-channels + +source rapids-date-string + +rapids-print-env + +rapids-logger "Begin py build" + +rapids-conda-retry mambabuild conda/recipes/rapids_build_backend + +rapids-upload-conda-to-s3 python diff --git a/conda/recipes/rapids-build-backend/meta.yaml b/conda/recipes/rapids-build-backend/meta.yaml new file mode 100644 index 0000000..7bc63d2 --- /dev/null +++ b/conda/recipes/rapids-build-backend/meta.yaml @@ -0,0 +1,66 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. + +{% set pyproject_data = load_file_data("pyproject.toml") %} +{% set version = pyproject_data.get('project', {}).get('version') %} +{% set summary = pyproject_data.get('project', {}).get('description') %} + +package: + name: rapids-build-backend + version: {{ version }} + +source: + path: ../../.. + +build: + number: 0 + noarch: python + script: python -m pip install . -vv --no-deps + +test: + requires: + - pip + - python >=3.9 + {% for r in pyproject_data.get("project", {}).get("optional-dependencies", {}).get("test", []) %} + - {{ r }} + {% endfor %} + source_files: + - tests/ + # Need the source for running tests, for whatever that's worth in a conda + # environment. + - rapids_build_backend/ + +requirements: + host: + - pip + - python >=3.9 + - conda-verify + {% for r in pyproject_data.get("build-system", {}).get("requires", []) %} + - {{ r }} + {% endfor %} + run: + {% for r in pyproject_data.get("project", {}).get("dependencies", []) %} + - {{ r }} + {% endfor %} + + # Automatically include all extras since we have no way to request optional + # subsets in conda. + {% for extra, extra_deps in pyproject_data.get("project", {}).get("optional-dependencies", {}).items() %} + {% if extra != "test" %} + {% for r in extra_deps %} + - {{ r }} + {% endfor %} + {% endif %} + {% endfor %} + +about: + home: https://rapids.ai/ + license: Apache-2.0 + license_file: LICENSE + summary: {{ summary }} + description: | + This package contains the PEP 517 build backend adapter used by all of + RAPIDS. It does not directly perform builds, but rather performs various + RAPIDS-specific metadata manipulations before calling down to another build + backend like setuptools to finish the job. + doc_url: https://docs.rapids.ai/ + dev_url: https://github.com/rapidsai/rapids-build-backend diff --git a/conda/recipes/rapids-build-backend/run_test.sh b/conda/recipes/rapids-build-backend/run_test.sh new file mode 100755 index 0000000..c7f221c --- /dev/null +++ b/conda/recipes/rapids-build-backend/run_test.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +# TODO: In a conda environment we should probably be testing without +# isolation for any tests to be meaningfully conda-specific. If we +# think that's worthwhile it will require adding an environment +# variable to conftest.py that controls whether the default `env` +# used for installation is a virtual environment or simply the +# current Python environment. +python -m pytest -v tests/