From 7cd1f4add5d21f81256b485daa8f16d68a46fd6e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 10 May 2024 17:05:05 -0500 Subject: [PATCH 1/3] warn if dependencies file does not exist, change default for 'dependencies-file' --- README.md | 16 ++++++++-------- rapids_build_backend/config.py | 2 +- rapids_build_backend/impls.py | 7 +++++++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 22a1277..94c4f3b 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,14 @@ In cases where more dynamic customization is sensible, suitable environment vari Any option without a default is required. -| Option | Definition | Type | Default | Supports dynamic modification | -|-----------------------|---------------------------------------------------------------------|----------------|---------------------|-------------------------------| -| `build-backend` | The wrapped build backend (e.g. `setuptools.build_meta`) | string | | N | -| `commit-file` | The file in which to write the git commit hash | string | "" (No file) | N | -| `dependencies-file` | The path to the `dependencies.yaml` file to use | string | "dependencies.yaml" | Y | -| `matrix-entry` | A `;`-separated list of `=`-delimited key/value pairs | string | "" | Y | -| `require-cuda` | If false, builds will succeed even if nvcc is not available | bool | true | Y | -| `requires` | List of build requirements (in addition to `build-system.requires`) | list[str] | [] | N | +| Option | Definition | Type | Default | Supports dynamic modification | +|-----------------------|---------------------------------------------------------------------|----------------|------------------------|-------------------------------| +| `build-backend` | The wrapped build backend (e.g. `setuptools.build_meta`) | string | | N | +| `commit-file` | The file in which to write the git commit hash | string | "" (No file) | N | +| `dependencies-file` | The path to the `dependencies.yaml` file to use | string | "../dependencies.yaml" | Y | +| `matrix-entry` | A `;`-separated list of `=`-delimited key/value pairs | string | "" | Y | +| `require-cuda` | If false, builds will succeed even if nvcc is not available | bool | true | Y | +| `requires` | List of build requirements (in addition to `build-system.requires`) | list[str] | [] | N | ## Outstanding questions diff --git a/rapids_build_backend/config.py b/rapids_build_backend/config.py index 4775dfb..305da0b 100644 --- a/rapids_build_backend/config.py +++ b/rapids_build_backend/config.py @@ -29,7 +29,7 @@ class Config: config_options: "config_options_type" = { "build-backend": (None, False), "commit-file": ("", False), - "dependencies-file": ("dependencies.yaml", True), + "dependencies-file": ("../dependencies.yaml", True), "matrix-entry": ("", True), "require-cuda": (True, True), "requires": (lambda: [], False), diff --git a/rapids_build_backend/impls.py b/rapids_build_backend/impls.py index 3dec619..088407b 100644 --- a/rapids_build_backend/impls.py +++ b/rapids_build_backend/impls.py @@ -4,6 +4,7 @@ import re import shutil import subprocess +import warnings from contextlib import contextmanager from functools import lru_cache from importlib import import_module @@ -172,6 +173,12 @@ def _edit_pyproject(config): config.dependencies_file ) except FileNotFoundError: + msg = ( + f"File not found: '{config.dependencies_file}'. If you want " + "rapids-build-backend to consider dependencies from a dependencies file, ", + "supply an existing file via config setting 'dependencies-file'.", + ) + warnings.warn(msg, stacklevel=2) parsed_config = None try: From 0fa5d577e04287cd86fa01f100bed92383e14af3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 13 May 2024 11:00:29 -0500 Subject: [PATCH 2/3] revert default value change --- README.md | 16 ++++++++-------- rapids_build_backend/config.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 94c4f3b..22a1277 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,14 @@ In cases where more dynamic customization is sensible, suitable environment vari Any option without a default is required. -| Option | Definition | Type | Default | Supports dynamic modification | -|-----------------------|---------------------------------------------------------------------|----------------|------------------------|-------------------------------| -| `build-backend` | The wrapped build backend (e.g. `setuptools.build_meta`) | string | | N | -| `commit-file` | The file in which to write the git commit hash | string | "" (No file) | N | -| `dependencies-file` | The path to the `dependencies.yaml` file to use | string | "../dependencies.yaml" | Y | -| `matrix-entry` | A `;`-separated list of `=`-delimited key/value pairs | string | "" | Y | -| `require-cuda` | If false, builds will succeed even if nvcc is not available | bool | true | Y | -| `requires` | List of build requirements (in addition to `build-system.requires`) | list[str] | [] | N | +| Option | Definition | Type | Default | Supports dynamic modification | +|-----------------------|---------------------------------------------------------------------|----------------|---------------------|-------------------------------| +| `build-backend` | The wrapped build backend (e.g. `setuptools.build_meta`) | string | | N | +| `commit-file` | The file in which to write the git commit hash | string | "" (No file) | N | +| `dependencies-file` | The path to the `dependencies.yaml` file to use | string | "dependencies.yaml" | Y | +| `matrix-entry` | A `;`-separated list of `=`-delimited key/value pairs | string | "" | Y | +| `require-cuda` | If false, builds will succeed even if nvcc is not available | bool | true | Y | +| `requires` | List of build requirements (in addition to `build-system.requires`) | list[str] | [] | N | ## Outstanding questions diff --git a/rapids_build_backend/config.py b/rapids_build_backend/config.py index 305da0b..4775dfb 100644 --- a/rapids_build_backend/config.py +++ b/rapids_build_backend/config.py @@ -29,7 +29,7 @@ class Config: config_options: "config_options_type" = { "build-backend": (None, False), "commit-file": ("", False), - "dependencies-file": ("../dependencies.yaml", True), + "dependencies-file": ("dependencies.yaml", True), "matrix-entry": ("", True), "require-cuda": (True, True), "requires": (lambda: [], False), From 95f0b19afae0f3824ae95df1b62c059bbc90f157 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 13 May 2024 11:07:47 -0500 Subject: [PATCH 3/3] add comment --- rapids_build_backend/impls.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rapids_build_backend/impls.py b/rapids_build_backend/impls.py index 088407b..80da594 100644 --- a/rapids_build_backend/impls.py +++ b/rapids_build_backend/impls.py @@ -168,6 +168,8 @@ def _edit_pyproject(config): cuda_version = _get_cuda_version(config.require_cuda) + # "dependencies.yaml" might not exist in sdists and wouldn't need to... so don't + # raise an exception if that file can't be found when this runs try: parsed_config = rapids_dependency_file_generator.load_config_from_file( config.dependencies_file