Skip to content

Commit

Permalink
make conda recipe data-loading stricter (#44)
Browse files Browse the repository at this point in the history
Contributes to rapidsai/build-planning#72

Proposes using `[]` subsetting instead of `.get()` in templating
statements in the conda recipe that read data out of `pyproject.toml`.
That'll ensure that we get a big loud build error if changes to
`pyproject.toml` remove some sections that the conda recipe expects to
exist.

Also proposes removing the logic for automatically including `run`
dependencies on all optional dependencies except those in the `[test]`
group... this project doesn't have any other optional dependencies.
  • Loading branch information
jameslamb authored Jun 12, 2024
1 parent 3e927c9 commit b6d7aad
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions conda/recipes/rapids-build-backend/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 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') %}
{% set version = pyproject_data["project"]["version"] %}
{% set summary = pyproject_data["project"]["description"] %}

package:
name: rapids-build-backend
Expand All @@ -21,28 +21,18 @@ requirements:
- pip
- python >=3.9
- conda-verify
{% for r in pyproject_data.get("build-system", {}).get("requires", []) %}
{% for r in pyproject_data["build-system"]["requires"] %}
- {{ r }}
{% endfor %}
run:
{% for r in pyproject_data.get("project", {}).get("dependencies", []) %}
{% for r in pyproject_data["project"]["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
license: {{ pyproject_data["project"]["license"]["text"] }}
license_file: {{ pyproject_data["tool"]["setuptools"]["license-files"][0] }}
summary: {{ summary }}
description: |
This package contains the PEP 517 build backend adapter used by all of
Expand Down

0 comments on commit b6d7aad

Please sign in to comment.