Skip to content

Commit

Permalink
Add conda recipe and corresponding CI build job
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Mar 13, 2024
1 parent 4af7df0 commit 603d69e
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
- wheel-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
conda-python-build:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
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/[email protected]
Expand Down
16 changes: 16 additions & 0 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
@@ -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
66 changes: 66 additions & 0 deletions conda/recipes/rapids-build-backend/meta.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions conda/recipes/rapids-build-backend/run_test.sh
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit 603d69e

Please sign in to comment.