diff --git a/cep-0014.md b/cep-0014.md index fe9c2837..5bbaa906 100644 --- a/cep-0014.md +++ b/cep-0014.md @@ -5,8 +5,8 @@ Status Accepted Author(s) Wolf Vollprecht <wolf@prefix.dev> Created May 23, 2023 - Updated Sep 26, 2025 - Discussion https://github.com/conda-incubator/ceps/pull/56 + Updated Jul 29, 2026 + Discussion https://github.com/conda-incubator/ceps/pull/56
https://github.com/conda/ceps/pull/186 Implementation https://github.com/prefix-dev/rattler-build @@ -47,6 +47,18 @@ If outputs exist, the top-level keys are 'merged' with the output keys (e.g. for ## Format +### Schema declaration + +To benefit from autocompletion and other JSON Schema-based features in editors and +third-party YAML tools, we can add a `$schema` URI reference to the recipe. + +```yaml +# a URL pointing at a JSON file... +$schema: https://raw.githubusercontent.com/prefix-dev/recipe-format/7e9363f2c/schema.json +# ... or relative POSIX path +# $schema: ./custom-recipe-schema.json +``` + ### Schema version The implicit version of the YAML schema for a recipe is an integer 1. @@ -59,12 +71,6 @@ The version can be explicitly set by adding a `schema_version` key to the recipe schema_version: 1 # integer ``` -To benefit from autocompletion, and other LSP features in editors, we can add a schema URL to the recipe. - -```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/prefix-dev/recipe-format/73cd2eed94c576213c5f25ab57adf6d8c83e792a/schema.json -``` - ### Context section The context section is a dictionary with key-value pairs that can be used for string interpolation. @@ -570,6 +576,10 @@ extra: What follows is an example recipe, using the YAML syntax discussed in ```yaml +$schema: https://raw.githubusercontent.com/prefix-dev/recipe-format/7e9363f2c/schema.json + +schema_version: 1 + context: name: xtensor version: 0.24.6 @@ -642,6 +652,10 @@ tests: Or a multi-output package ```yaml +$schema: https://raw.githubusercontent.com/prefix-dev/recipe-format/7e9363f2c/schema.json + +schema_version: 1 + context: name: mamba libmamba_version: "1.4.2" @@ -841,3 +855,4 @@ extra: - September 24, 2025: Removed `about.license_url` as the field exists but is unused in `conda-build`. - September 26, 2025: Permits lists of scalars in `context`. +- July 29, 2026: Permits `$schema`.