From 7e4a8725b696dba7af43473e5cfbb6fc8df19bcf Mon Sep 17 00:00:00 2001 From: Bas Zalmstra Date: Fri, 1 Dec 2023 18:03:54 +0100 Subject: [PATCH] fix: align with latest cep changes --- .ruff.toml | 1 + examples/mamba/recipe.yaml | 19 +- examples/zlib/recipe.yaml | 17 +- model.py | 417 ++++--- schema.json | 2355 +++++++++++++++++------------------- 5 files changed, 1372 insertions(+), 1437 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index 625069e..332d667 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -6,6 +6,7 @@ ignore = [ "D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d "COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/ "ISC001", # https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/ + "T201" # https://docs.astral.sh/ruff/rules/print/ ] [format] diff --git a/examples/mamba/recipe.yaml b/examples/mamba/recipe.yaml index 1e23232..9cc1176 100644 --- a/examples/mamba/recipe.yaml +++ b/examples/mamba/recipe.yaml @@ -1,5 +1,7 @@ # yaml-language-server: $schema=../../schema.json +schema_version: 1 + context: name: mamba libmamba_version: "1.4.2" @@ -28,12 +30,11 @@ outputs: build: script: ${{ "build_mamba.sh" if unix else "build_mamba.bat" }} - run_exports: - - ${{ pin_subpackage('libmamba', max_pin='x.x') }} ignore_run_exports: - - spdlog - - if: win - then: python + from_package: + - spdlog + - if: win + then: python requirements: build: @@ -55,6 +56,8 @@ outputs: - fmt - if: win then: winreg + run_exports: + - ${{ pin_subpackage('libmamba', max_pin='x.x') }} test: - script: @@ -83,9 +86,8 @@ outputs: build: script: ${{ "build_mamba.sh" if unix else "build_mamba.bat" }} string: py${{ CONDA_PY }}h${{ PKG_HASH }}_${{ PKG_BUILDNUM }} - run_exports: - - ${{ pin_subpackage('libmambapy', max_pin='x.x') }} ignore_run_exports: + from_package: - spdlog requirements: build: @@ -114,6 +116,8 @@ outputs: run: - python - ${{ pin_subpackage('libmamba', exact=True) }} + run_exports: + - ${{ pin_subpackage('libmambapy', max_pin='x.x') }} test: - imports: @@ -128,6 +132,7 @@ outputs: build: script: ${{ "build_mamba.sh" if unix else "build_mamba.bat" }} string: py${{ CONDA_PY }}h${{ PKG_HASH }}_${{ PKG_BUILDNUM }} + python: entry_points: - mamba = mamba.mamba:main requirements: diff --git a/examples/zlib/recipe.yaml b/examples/zlib/recipe.yaml index f617ebf..bb15c9e 100644 --- a/examples/zlib/recipe.yaml +++ b/examples/zlib/recipe.yaml @@ -6,20 +6,19 @@ context: recipe: name: zlib-split - version: ${{version}} + version: 1.2.13 source: - url: http://zlib.net/zlib-${{ version }}.tar.gz + url: http://zlib.net/zlib-${{ recipe.version }}.tar.gz sha256: b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30 outputs: - package: name: libzlib build: - run_exports: - - ${{ pin_subpackage('libzlib', max_pin='x.x') }} script: - echo "build libzlib" + requirements: build: - ${{ compiler('c') }} @@ -27,6 +26,8 @@ outputs: run: run_constrained: - zlib ${{ version }} *_${{ build_num }} + run_exports: + - ${{ pin_subpackage('libzlib', max_pin='x.x') }} test: - script: @@ -45,8 +46,6 @@ outputs: build: skip: - not win - run_exports: - - ${{ pin_subpackage('libzlib-wapi', max_pin='x.x') }} requirements: build: - ${{ compiler('c') }} @@ -55,6 +54,8 @@ outputs: run_constrained: - zlib ${{ version }} *_${{ build_num }} - zlib-wapi ${{ version }} *_${{ build_num }} + run_exports: + - ${{ pin_subpackage('libzlib-wapi', max_pin='x.x') }} files: - Library/bin/zlibwapi.dll # [win] test: @@ -64,8 +65,6 @@ outputs: - package: name: zlib build: - run_exports: - - ${{ pin_subpackage('libzlib', max_pin='x.x') }} script: - echo "build zlib" requirements: @@ -75,6 +74,8 @@ outputs: - ${{ pin_subpackage('libzlib', exact=True) }} run: - ${{ pin_subpackage('libzlib', exact=True) }} + run_exports: + - ${{ pin_subpackage('libzlib', max_pin='x.x') }} test: - extra_requirements: diff --git a/model.py b/model.py index 4fc6717..577ba94 100644 --- a/model.py +++ b/model.py @@ -1,8 +1,7 @@ from __future__ import annotations import json -from pathlib import Path -from typing import Any, Generic, Literal, TypeVar, Union +from typing import Annotated, Any, Generic, Literal, TypeVar, Union from pydantic import ( AnyHttpUrl, @@ -14,6 +13,12 @@ ) NonEmptyStr = constr(min_length=1) +PathNoBackslash = constr(pattern=r"^[^\\]+$") +Glob = NonEmptyStr +UnsignedInt = conint(ge=0) +GitUrl = constr( + pattern=r"/((git|ssh|http(s)?)|(git@[\w\.]+))(:(\/\/)?)([\w\.@\:\/\-~]+)(\.git)(\/)?/igm" +) class StrictBaseModel(BaseModel): @@ -36,7 +41,7 @@ class IfStatement(BaseModel, Generic[T]): ################### -# Package section # +# Package section # ################### @@ -64,43 +69,58 @@ class ComplexPackage(StrictBaseModel): class BaseSource(StrictBaseModel): patches: ConditionalList[PathNoBackslash] = Field( - [], - description="A list of patches to apply after fetching the source", + [], description="A list of patches to apply after fetching the source" ) - folder: str | None = Field( - None, - description="The location in the working directory to place the source", + target_directory: NonEmptyStr | None = Field( + None, description="The location in the working directory to place the source" ) class UrlSource(BaseSource): - url: str = Field( + url: NonEmptyStr | list[NonEmptyStr] = Field( ..., - description="The url that points to the source. This should be an archive that is extracted in the working directory.", - ) - sha256: SHA256Str | None = Field( - None, - description="The SHA256 hash of the source archive", + description="Rrl pointing to the source tar.gz|zip|tar.bz2|... (this can be a list of mirrors that point to the same file)", ) - md5: MD5Str | None = Field( + sha256: SHA256Str | None = Field(None, description="The SHA256 hash of the source archive") + md5: MD5Str | None = Field(None, description="The MD5 hash of the source archive") + file_name: NonEmptyStr | None = Field( None, - description="The MD5 hash of the source archive", + description="A file name to rename the downloaded file to (does not apply to archives).", ) -class GitSource(BaseSource): - git_rev: str = Field("HEAD", description="The git rev the checkout.") - git_url: str = Field(..., description="The url that points to the git repository.") - git_depth: int | None = Field( - None, - description="A value to use when shallow cloning the repository.", +class BaseGitSource(BaseSource): + git: GitUrl | JinjaExpr = Field(..., description="The url that points to the git repository.") + depth: UnsignedInt | None = Field( + None, description="A value to use when shallow cloning the repository." ) + lfs: bool = Field(default=False, description="Should we LFS files be checked out as well") + + +class GitRev(BaseGitSource): + rev: NonEmptyStr = Field(..., description="Revision to checkout to (hash or ref)") + + +class GitTag(BaseGitSource): + tag: NonEmptyStr = Field(..., description="Tag to checkout") + + +class GitBranch(BaseGitSource): + branch: NonEmptyStr = Field(..., description="Branch to check out") + + +GitSource = GitRev | GitTag | GitBranch class LocalSource(BaseSource): - path: str = Field( - ..., - description="A path on the local machine that contains the source.", + path: str = Field(..., description="A path on the local machine that contains the source.") + use_gitignore: bool = Field( + default=True, + description="Whether or not to use the .gitignore file when copying the source.", + ) + file_name: NonEmptyStr | None = Field( + None, + description="A file name to rename the file to (does not apply to archives).", ) @@ -111,31 +131,25 @@ class LocalSource(BaseSource): ################### PythonEntryPoint = str -PathNoBackslash = constr(pattern=r"^[^\\]+$") MatchSpec = str -MatchSpecList = ConditionalList[MatchSpec] -UnsignedInt = conint(ge=0) - class RunExports(StrictBaseModel): - weak: MatchSpecList | None = Field( - None, - description="Weak run exports apply from the host env to the run env", + weak: ConditionalList[MatchSpec] | None = Field( + None, description="Weak run exports apply from the host env to the run env" ) - strong: MatchSpecList | None = Field( + strong: ConditionalList[MatchSpec] | None = Field( None, description="Strong run exports apply from the build and host env to the run env", ) - noarch: MatchSpecList | None = Field( + noarch: ConditionalList[MatchSpec] | None = Field( None, description="Noarch run exports are the only ones looked at when building noarch packages", ) - weak_constrains: MatchSpecList | None = Field( - None, - description="Weak run constrains add run_constrains from the host env", + weak_constrains: ConditionalList[MatchSpec] | None = Field( + None, description="Weak run constrains add run_constrains from the host env" ) - strong_constrains: MatchSpecList | None = Field( + strong_constrains: ConditionalList[MatchSpec] | None = Field( None, description="Strong run constrains add run_constrains from the build and host env", ) @@ -147,8 +161,7 @@ class ScriptEnv(StrictBaseModel): description="Environments variables to leak into the build environment from the host system. During build time these variables are recorded and stored in the package output. Use `secrets` for environment variables that should not be recorded.", ) env: dict[str, str] = Field( - {}, - description="Environment variables to set in the build environment.", + {}, description="Environment variables to set in the build environment." ) secrets: ConditionalList[NonEmptyStr] = Field( [], @@ -164,140 +177,181 @@ class Build(StrictBaseModel): 0, description="Build number to version current build in addition to package version", ) - string: str | None = Field( - None, - description="Build string to identify build variant (if not explicitly set, computed automatically from used build variant)", - ) - skip: ConditionalList[NonEmptyStr] | None = Field( + string: str | JinjaExpr | None = Field( None, - description="List of conditions under which to skip the build of the package.", + description="The build string to identify build variant. This is usually omitted (can use `${{ hash }}`) variable here)", ) - script: ConditionalList[NonEmptyStr] | None = Field( + skip: list[str | bool] | None = Field( None, - description="Build script to be used. If not given, tries to find 'build.sh' on Unix or 'bld.bat' on Windows inside the recipe folder.", + description="List of conditions under which to skip the build of the package. If any of these condition returns true the build is skipped.", ) - noarch: Literal["generic", "python"] | None = Field( None, description="Can be either 'generic' or 'python'. A noarch 'python' package compiles .pyc files upon installation.", ) - # Note: entry points only valid if noarch: python is used! Write custom validator? - entry_points: ConditionalList[PythonEntryPoint] | None = Field( + + script: str | Script | ConditionalList[NonEmptyStr] | None = Field( None, - description="Only valid if `noarch: python` - list of all entry points of the package. e.g. `bsdiff4 = bsdiff4.cli:main_bsdiff4`", + description="The script to execute to invoke the build. If the string is a single line and ends with `.sh` or `.bat`, then we interpret it as a file.", ) - run_exports: RunExports | MatchSpecList | None = Field( - None, - description="Additional `run` dependencies added to a package that is build against this package.", + merge_build_and_host_envs: bool | JinjaExpr | None = Field( + default=False, + description="Merge the build and host environments (used in many R packages on Windows)", ) - ignore_run_exports: ConditionalList[NonEmptyStr] | None = Field( - None, - description="Ignore specific `run` dependencies that are added by dependencies in our `host` requirements section that have`run_exports`.", + + always_include_files: ConditionalList[NonEmptyStr] = Field( + [], + description="Files to be included even if they are present in the PREFIX before building.", ) - ignore_run_exports_from: ConditionalList[NonEmptyStr] | None = Field( - None, - description="Ignore `run_exports` from the specified dependencies in our `host` section.`", + variant: Variant | None = Field( + None, description="Options that influence how the different variants are computed." + ) + python: Python | None = Field(None, description="Python specific build configuration") + shared_libraries: SharedLibraries | None = Field( + None, description="Shared library specific build configuration" + ) + ignore_run_exports: IgnoreRunExports | None = Field( + None, description="Ignore run-exports by name or from certain packages" ) - # deprecated, but still used to downweigh packages - track_features: ConditionalList[NonEmptyStr] | None = Field( + link_options: LinkOptions | None = Field( None, - description="deprecated, but still used to downweigh packages", + description="Options that influence how a package behaves when it is installed or uninstalled.", ) - # Features are completely deprecated - # provides_features: Dict[str, str], - include_recipe: bool = Field( - default=True, - description="Whether or not to include the rendered recipe in the final package.", +class BaseScript(StrictBaseModel): + interpreter: NonEmptyStr | None = Field( + default=None, + description="The interpreter to use for the script.\n\nDefaults to `bash` on unix and `cmd.exe` on Windows.", ) - - pre_link: str | None = Field( - None, - alias="pre-link", - description="Script to execute when installing - before linking. Highly discouraged!", + env: dict[NonEmptyStr, str] = Field( + default={}, + description='the script environment.\n\nYou can use Jinja to pass through environments variables with the `env` object (e.g. `${{ env.get("MYVAR") }}`)', ) - post_link: str | None = Field( - None, - alias="post-link", - description="Script to execute when installing - after linking.", + secrets: ConditionalList[NonEmptyStr] = Field( + default=[], + description="Secrets that are set as environment variables but never shown in the logs or the environment.", ) - pre_unlink: str | None = Field( - None, - alias="pre-unlink", - description="Script to execute when removing - before unlinking.", + + +class FileScript(BaseScript): + file: PathNoBackslash | JinjaExpr = Field( + description="The file to use as the script. Automatically adds the `bat` or `sh` to the filename on Windows or Unix respectively (if no file extension is given)." ) - no_link: ConditionalList[PathNoBackslash] | None = Field( - None, - description="A list of files that are included in the package but should not be installed when installing the package.", + +class ContentScript(BaseScript): + content: str | ConditionalList[str] = Field( + description="A string or list of strings that is the scripts contents" ) - binary_relocation: Literal[False] | ConditionalList[PathNoBackslash] = Field( + + +Script = FileScript | ContentScript + + +class Variant(StrictBaseModel): + use_keys: ConditionalList[NonEmptyStr] = Field( [], - description="A list of files that should be excluded from binary relocation or False to ignore all binary files.", + description="Keys to forcibly use for the variant computation (even if they are not in the dependencies)", ) - has_prefix_files: ConditionalList[PathNoBackslash] = Field( + ignore_keys: ConditionalList[NonEmptyStr] = Field( [], - description="A list of files to force being detected as A TEXT file for prefix replacement.", + description="Keys to forcibly ignore for the variant computation (even if they are in the dependencies)", ) - binary_has_prefix_files: ConditionalList[PathNoBackslash] = Field( - [], - description="A list of files to force being detected as A BINARY file for prefix replacement.", + + down_prioritize_variant: int | JinjaExpr = Field( + 0, description="used to prefer this variant less over other variants" ) - ignore_prefix_files: Literal[True] | ConditionalList[PathNoBackslash] = Field( + + +class Python(StrictBaseModel): + entry_points: ConditionalList[PythonEntryPoint] = Field( [], - description="A list of files that are not considered for prefix replacement, or True to ignore all files.", ) - # the following is defaulting to True on UNIX and False on Windows - detect_binary_files_with_prefix: bool | None = Field( - None, - description="Wether to detect binary files with prefix or not. Defaults to True on Unix and False on Windows.", + use_python_app_entrypoint: bool | JinjaExpr = Field( + default=False, + description="Specifies if python.app should be used as the entrypoint on macOS. (macOS only)", ) - skip_compile_pyc: ConditionalList[PathNoBackslash] | None = Field( - None, - description="A list of python files that should not be compiled to .pyc files at install time.", - ) + preserve_egg_dir: bool | JinjaExpr = Field(default=False) - rpaths: ConditionalList[NonEmptyStr] = Field( - ["lib/"], - description="A list of rpaths (Linux only).", + skip_pyc_compilation: ConditionalList[Glob] = Field( + default=[], description="Skip compiling pyc for some files" ) - # Note: this deviates from conda-build `script_env`! - script_env: ScriptEnv | None = Field( - None, - description="Environment variables to either pass through to the script environment or set.", - ) + disable_pip: bool | JinjaExpr = Field(default=False) - # Files to be included even if they are present in the PREFIX before building - always_include_files: ConditionalList[NonEmptyStr] = Field( - [], - description="Files to be included even if they are present in the PREFIX before building.", + +class PrefixDetection(StrictBaseModel): + force_file_type: ForceFileType | None = Field( + None, description="force the file type of the given files to be TEXT or BINARY" + ) + ignore: bool | JinjaExpr | ConditionalList[PathNoBackslash] = Field( + default=False, description="Ignore all or specific files for prefix replacement" + ) + ignore_binary_files: bool | JinjaExpr | ConditionalList[PathNoBackslash] = Field( + default=False, description="Wether to detect binary files with prefix or not" ) - # pin_depends: Optional[str] -- did not find usage anywhere, removed - # preferred_env_executable_paths': Optional[List] - osx_is_app: bool = False - disable_pip: bool = False - preserve_egg_dir: bool = False +class ForceFileType(StrictBaseModel): + text: ConditionalList[Glob] = Field(default=[], description="force TEXT file type") + binary: ConditionalList[Glob] = Field(default=[], description="force BINARY file type") - # note didnt find _any_ usage of force_use_keys in conda-forge - force_use_keys: ConditionalList[NonEmptyStr] | None = None - force_ignore_keys: ConditionalList[NonEmptyStr] | None = None - merge_build_host: bool = False +class SharedLibraries(StrictBaseModel): + rpaths: ConditionalList[NonEmptyStr] = Field( + default=["lib/"], description="linux only, list of rpaths (was rpath)" + ) + binary_relocation: bool | JinjaExpr | ConditionalList[Glob] = Field( + default=True, + description="Wether to relocate binaries or not. If this is a list of paths then only the listed paths are relocated", + ) + missing_dso_allowlist: ConditionalList[Glob] = Field( + default=[], + description="Allow linking against libraries that are not in the run requirements", + ) + rpath_allowlist: ConditionalList[Glob] = Field( + default=[], + description="Allow runpath/rpath to point to these locations outside of the environment", + ) + overdepending_behavior: Literal["ignore", "error"] = Field( + "error", + description="What to do when detecting overdepending. Overdepending means that a requirement a run requirement is specified but none of the artifacts from the build link against any of the shared libraries of the requirement.", + ) + overlinking_behavior: Literal["ignore", "error"] = Field( + "error", + description="What to do when detecting overdepending. Overlinking occurs when an artifact links against a library that was not specified in the run requirements.", + ) - missing_dso_whitelist: ConditionalList[NonEmptyStr] | None = None - runpath_whitelist: ConditionalList[NonEmptyStr] | None = None - error_overdepending: bool = Field(default=False, description="Error on overdepending") - error_overlinking: bool = Field(default=False, description="Error on overlinking") +class IgnoreRunExports(StrictBaseModel): + by_name: ConditionalList[NonEmptyStr] = Field( + default=[], description="ignore run exports by name (e.g. `libgcc-ng`)" + ) + from_package: ConditionalList[NonEmptyStr] = Field( + default=[], description="ignore run exports that come from the specified packages" + ) + + +class LinkOptions(StrictBaseModel): + post_link_script: NonEmptyStr | None = Field( + None, + description="Script to execute after the package has been linked into an environment", + ) + pre_unlink_script: NonEmptyStr | None = Field( + None, + description="Script to execute before uninstalling the package from an environment", + ) + pre_link_message: NonEmptyStr | None = Field(None, description="Message to show before linking") + always_copy_files: ConditionalList[Glob] = Field( + [], + description="Do not soft- or hard-link these files but instead always copy them into the environment", + ) ######################### @@ -306,21 +360,23 @@ class Build(StrictBaseModel): class Requirements(StrictBaseModel): - build: MatchSpecList | None = Field( + build: ConditionalList[MatchSpec] | None = Field( None, description="Dependencies to install on the build platform architecture. Compilers, CMake, everything that needs to execute at build time.", ) - host: MatchSpecList | None = Field( + host: ConditionalList[MatchSpec] | None = Field( None, description="Dependencies to install on the host platform architecture. All the packages that your build links against.", ) - run: MatchSpecList | None = Field( + run: ConditionalList[MatchSpec] | None = Field( None, description="Dependencies that should be installed alongside this package. Dependencies in the `host` section with `run_exports` are also automatically added here.", ) - run_constrained: MatchSpecList | None = Field( - None, - description="Constrained optional dependencies at runtime.", + run_constrained: ConditionalList[MatchSpec] | None = Field( + None, description="Constrained optional dependencies at runtime." + ) + run_exports: ConditionalList[MatchSpec] | RunExports = Field( + None, description="The run exports of this package" ) @@ -330,36 +386,31 @@ class Requirements(StrictBaseModel): class TestElementRequires(StrictBaseModel): - build: MatchSpecList | None = Field( + build: ConditionalList[MatchSpec] | None = Field( None, description="extra requirements with build_platform architecture (emulators, ...)", ) - run: MatchSpecList | None = Field(None, description="extra run dependencies") + run: ConditionalList[MatchSpec] | None = Field(None, description="extra run dependencies") class TestElementFiles(StrictBaseModel): source: ConditionalList[NonEmptyStr] | None = Field( - None, - description="extra files from $SRC_DIR", + None, description="extra files from $SRC_DIR" ) recipe: ConditionalList[NonEmptyStr] | None = Field( - None, - description="extra files from $RECIPE_DIR", + None, description="extra files from $RECIPE_DIR" ) class CommandTestElement(StrictBaseModel): script: ConditionalList[NonEmptyStr] = Field( - None, - description="A script to run to perform the test.", + None, description="A script to run to perform the test." ) extra_requirements: TestElementRequires | None = Field( - None, - description="Additional dependencies to install before running the test.", + None, description="Additional dependencies to install before running the test." ) files: TestElementFiles | None = Field( - None, - description="Additional files to include for the test.", + None, description="Additional files to include for the test." ) @@ -393,39 +444,24 @@ class DescriptionFile(StrictBaseModel): class About(StrictBaseModel): # URLs - homepage: AnyHttpUrl | None = Field( - None, - description="Url of the homepage of the package.", - ) + homepage: AnyHttpUrl | None = Field(None, description="Url of the homepage of the package.") repository: AnyHttpUrl | None = Field( None, description="Url that points to where the source code is hosted e.g. (github.com)", ) documentation: AnyHttpUrl | None = Field( - None, - description="Url that points to where the documentation is hosted.", + None, description="Url that points to where the documentation is hosted." ) # License - license_: str | None = Field( - None, - alias="license", - description="An license in SPDX format.", - ) + license_: str | None = Field(None, alias="license", description="An license in SPDX format.") license_file: ConditionalList[PathNoBackslash] | None = Field( - None, - description="Paths to the license files of this package.", - ) - license_url: str | None = Field( - None, - description="A url that points to the license file.", + None, description="Paths to the license files of this package." ) + license_url: str | None = Field(None, description="A url that points to the license file.") # Text - summary: str | None = Field( - None, - description="A short description of the package.", - ) + summary: str | None = Field(None, description="A short description of the package.") description: str | DescriptionFile | None = Field( None, description="Extented description of the package or a file (usually a README).", @@ -452,23 +488,17 @@ class OutputBuild(Build): class Output(BaseModel): package: ComplexPackage | None = Field( - None, - description="The package name and version, this overwrites any top-level fields.", + None, description="The package name and version, this overwrites any top-level fields." ) source: ConditionalList[Source] | None = Field( - None, - description="The source items to be downloaded and used for the build.", + None, description="The source items to be downloaded and used for the build." ) build: OutputBuild | None = Field( - None, - description="Describes how the package should be build.", + None, description="Describes how the package should be build." ) - requirements: Requirements | None = Field( - None, - description="The package dependencies", - ) + requirements: Requirements | None = Field(None, description="The package dependencies") test: list[ TestElement | IfStatement[TestElement] | list[TestElement | IfStatement[TestElement]] @@ -489,25 +519,26 @@ class Output(BaseModel): # The Recipe itself # ##################### +SchemaVersion = Annotated[int, Field(ge=1, le=1)] + class BaseRecipe(StrictBaseModel): + schema_version: SchemaVersion = Field( + 1, + description="The version of the YAML schema for a recipe. If the version is omitted it is assumed to be 1.", + ) + context: dict[str, Any] | None = Field( - None, - description="Defines arbitrary key-value pairs for Jinja interpolation", + None, description="Defines arbitrary key-value pairs for Jinja interpolation" ) source: None | Source | IfStatement[Source] | list[Source | IfStatement[Source]] = Field( - None, - description="The source items to be downloaded and used for the build.", - ) - build: Build | None = Field( - None, - description="Describes how the package should be build.", + None, description="The source items to be downloaded and used for the build." ) + build: Build | None = Field(None, description="Describes how the package should be build.") about: About | None = Field( - None, - description="A human readable description of the package information", + None, description="A human readable description of the package information" ) extra: dict[str, Any] | None = Field( None, @@ -519,8 +550,7 @@ class ComplexRecipe(BaseRecipe): recipe: ComplexPackage | None = Field(None, description="The package version.") outputs: ConditionalList[Output] = Field( - ..., - description="A list of outputs that are generated for this recipe.", + ..., description="A list of outputs that are generated for this recipe." ) @@ -528,19 +558,14 @@ class SimpleRecipe(BaseRecipe): package: SimplePackage = Field(..., description="The package name and version.") test: ConditionalList[TestElement] | None = Field( - None, - description="Tests to run after packaging", + None, description="Tests to run after packaging" ) - requirements: Requirements | None = Field( - None, - description="The package dependencies", - ) + requirements: Requirements | None = Field(None, description="The package dependencies") Recipe = TypeAdapter(SimpleRecipe | ComplexRecipe) if __name__ == "__main__": - with Path.open("schema.json", "w") as f: - f.write(json.dumps(Recipe.json_schema(), indent=2)) + print(json.dumps(Recipe.json_schema(), indent=2)) diff --git a/schema.json b/schema.json index b69b2d4..b1459ff 100644 --- a/schema.json +++ b/schema.json @@ -176,32 +176,28 @@ { "type": "string" }, + { + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" + }, { "type": "null" } ], "default": null, - "description": "Build string to identify build variant (if not explicitly set, computed automatically from used build variant)", + "description": "The build string to identify build variant. This is usually omitted (can use `${{ hash }}`) variable here)", "title": "String" }, "skip": { "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, { "items": { "anyOf": [ { - "minLength": 1, "type": "string" }, { - "$ref": "#/$defs/IfStatement" + "type": "boolean" } ] }, @@ -212,11 +208,37 @@ } ], "default": null, - "description": "List of conditions under which to skip the build of the package.", + "description": "List of conditions under which to skip the build of the package. If any of these condition returns true the build is skipped.", "title": "Skip" }, + "noarch": { + "anyOf": [ + { + "enum": [ + "generic", + "python" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Can be either 'generic' or 'python'. A noarch 'python' package compiles .pyc files upon installation.", + "title": "Noarch" + }, "script": { "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/FileScript" + }, + { + "$ref": "#/$defs/ContentScript" + }, { "minLength": 1, "type": "string" @@ -243,29 +265,30 @@ } ], "default": null, - "description": "Build script to be used. If not given, tries to find 'build.sh' on Unix or 'bld.bat' on Windows inside the recipe folder.", + "description": "The script to execute to invoke the build. If the string is a single line and ends with `.sh` or `.bat`, then we interpret it as a file.", "title": "Script" }, - "noarch": { + "merge_build_and_host_envs": { "anyOf": [ { - "enum": [ - "generic", - "python" - ], + "type": "boolean" + }, + { + "pattern": "\\$\\{\\{.*\\}\\}", "type": "string" }, { "type": "null" } ], - "default": null, - "description": "Can be either 'generic' or 'python'. A noarch 'python' package compiles .pyc files upon installation.", - "title": "Noarch" + "default": false, + "description": "Merge the build and host environments (used in many R packages on Windows)", + "title": "Merge Build And Host Envs" }, - "entry_points": { + "always_include_files": { "anyOf": [ { + "minLength": 1, "type": "string" }, { @@ -275,6 +298,7 @@ "items": { "anyOf": [ { + "minLength": 1, "type": "string" }, { @@ -283,48 +307,80 @@ ] }, "type": "array" + } + ], + "default": [], + "description": "Files to be included even if they are present in the PREFIX before building.", + "title": "Always Include Files" + }, + "variant": { + "anyOf": [ + { + "$ref": "#/$defs/Variant" }, { "type": "null" } ], "default": null, - "description": "Only valid if `noarch: python` - list of all entry points of the package. e.g. `bsdiff4 = bsdiff4.cli:main_bsdiff4`", - "title": "Entry Points" + "description": "Options that influence how the different variants are computed." }, - "run_exports": { + "python": { "anyOf": [ { - "$ref": "#/$defs/RunExports" + "$ref": "#/$defs/Python" }, { - "type": "string" - }, + "type": "null" + } + ], + "default": null, + "description": "Python specific build configuration" + }, + "shared_libraries": { + "anyOf": [ { - "$ref": "#/$defs/IfStatement" + "$ref": "#/$defs/SharedLibraries" }, { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "type": "null" + } + ], + "default": null, + "description": "Shared library specific build configuration" + }, + "ignore_run_exports": { + "anyOf": [ + { + "$ref": "#/$defs/IgnoreRunExports" }, { "type": "null" } ], "default": null, - "description": "Additional `run` dependencies added to a package that is build against this package.", - "title": "Run Exports" + "description": "Ignore run-exports by name or from certain packages" }, - "ignore_run_exports": { + "link_options": { + "anyOf": [ + { + "$ref": "#/$defs/LinkOptions" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Options that influence how a package behaves when it is installed or uninstalled." + } + }, + "title": "Build", + "type": "object" + }, + "CommandTestElement": { + "additionalProperties": false, + "properties": { + "script": { "anyOf": [ { "minLength": 1, @@ -346,64 +402,132 @@ ] }, "type": "array" + } + ], + "default": null, + "description": "A script to run to perform the test.", + "title": "Script" + }, + "extra_requirements": { + "anyOf": [ + { + "$ref": "#/$defs/TestElementRequires" }, { "type": "null" } ], "default": null, - "description": "Ignore specific `run` dependencies that are added by dependencies in our `host` requirements section that have`run_exports`.", - "title": "Ignore Run Exports" + "description": "Additional dependencies to install before running the test." }, - "ignore_run_exports_from": { + "files": { "anyOf": [ { - "minLength": 1, - "type": "string" + "$ref": "#/$defs/TestElementFiles" }, { - "$ref": "#/$defs/IfStatement" + "type": "null" + } + ], + "default": null, + "description": "Additional files to include for the test." + } + }, + "title": "CommandTestElement", + "type": "object" + }, + "ComplexPackage": { + "additionalProperties": false, + "properties": { + "name": { + "description": "The recipe name, this is only used to identify the name of the recipe.", + "title": "Name", + "type": "string" + }, + "version": { + "anyOf": [ + { + "type": "string" }, { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "type": "null" + } + ], + "default": null, + "description": "The version of each output, this can be overwritten per output", + "title": "Version" + } + }, + "required": [ + "name" + ], + "title": "ComplexPackage", + "type": "object" + }, + "ComplexRecipe": { + "additionalProperties": false, + "properties": { + "schema_version": { + "default": 1, + "description": "The version of the YAML schema for a recipe. If the version is omitted it is assumed to be 1.", + "maximum": 1, + "minimum": 1, + "title": "Schema Version", + "type": "integer" + }, + "context": { + "anyOf": [ + { + "type": "object" }, { "type": "null" } ], "default": null, - "description": "Ignore `run_exports` from the specified dependencies in our `host` section.`", - "title": "Ignore Run Exports From" + "description": "Defines arbitrary key-value pairs for Jinja interpolation", + "title": "Context" }, - "track_features": { + "source": { "anyOf": [ { - "minLength": 1, - "type": "string" + "$ref": "#/$defs/UrlSource" }, { - "$ref": "#/$defs/IfStatement" + "$ref": "#/$defs/GitRev" + }, + { + "$ref": "#/$defs/GitTag" + }, + { + "$ref": "#/$defs/GitBranch" + }, + { + "$ref": "#/$defs/LocalSource" + }, + { + "$ref": "#/$defs/IfStatement_Union_UrlSource__GitRev__GitTag__GitBranch__LocalSource__" }, { "items": { "anyOf": [ { - "minLength": 1, - "type": "string" + "$ref": "#/$defs/UrlSource" }, { - "$ref": "#/$defs/IfStatement" + "$ref": "#/$defs/GitRev" + }, + { + "$ref": "#/$defs/GitTag" + }, + { + "$ref": "#/$defs/GitBranch" + }, + { + "$ref": "#/$defs/LocalSource" + }, + { + "$ref": "#/$defs/IfStatement_Union_UrlSource__GitRev__GitTag__GitBranch__LocalSource__" } ] }, @@ -414,59 +538,62 @@ } ], "default": null, - "description": "deprecated, but still used to downweigh packages", - "title": "Track Features" + "description": "The source items to be downloaded and used for the build.", + "title": "Source" }, - "include_recipe": { - "default": true, - "description": "Whether or not to include the rendered recipe in the final package.", - "title": "Include Recipe", - "type": "boolean" + "build": { + "anyOf": [ + { + "$ref": "#/$defs/Build" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Describes how the package should be build." }, - "pre-link": { + "about": { "anyOf": [ { - "type": "string" + "$ref": "#/$defs/About" }, { "type": "null" } ], "default": null, - "description": "Script to execute when installing - before linking. Highly discouraged!", - "title": "Pre-Link" + "description": "A human readable description of the package information" }, - "post-link": { + "extra": { "anyOf": [ { - "type": "string" + "type": "object" }, { "type": "null" } ], "default": null, - "description": "Script to execute when installing - after linking.", - "title": "Post-Link" + "description": "An set of arbitrary values that are included in the package manifest", + "title": "Extra" }, - "pre-unlink": { + "recipe": { "anyOf": [ { - "type": "string" + "$ref": "#/$defs/ComplexPackage" }, { "type": "null" } ], "default": null, - "description": "Script to execute when removing - before unlinking.", - "title": "Pre-Unlink" + "description": "The package version." }, - "no_link": { + "outputs": { "anyOf": [ { - "pattern": "^[^\\\\]+$", - "type": "string" + "$ref": "#/$defs/Output" }, { "$ref": "#/$defs/IfStatement" @@ -475,8 +602,7 @@ "items": { "anyOf": [ { - "pattern": "^[^\\\\]+$", - "type": "string" + "$ref": "#/$defs/Output" }, { "$ref": "#/$defs/IfStatement" @@ -484,22 +610,48 @@ ] }, "type": "array" - }, - { - "type": "null" } ], - "default": null, - "description": "A list of files that are included in the package but should not be installed when installing the package.", - "title": "No Link" - }, - "binary_relocation": { - "anyOf": [ - { - "const": false + "description": "A list of outputs that are generated for this recipe.", + "title": "Outputs" + } + }, + "required": [ + "outputs" + ], + "title": "ComplexRecipe", + "type": "object" + }, + "ContentScript": { + "additionalProperties": false, + "properties": { + "interpreter": { + "anyOf": [ + { + "minLength": 1, + "type": "string" }, { - "pattern": "^[^\\\\]+$", + "type": "null" + } + ], + "default": null, + "description": "The interpreter to use for the script.\n\nDefaults to `bash` on unix and `cmd.exe` on Windows.", + "title": "Interpreter" + }, + "env": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "the script environment.\n\nYou can use Jinja to pass through environments variables with the `env` object (e.g. `${{ env.get(\"MYVAR\") }}`)", + "title": "Env", + "type": "object" + }, + "secrets": { + "anyOf": [ + { + "minLength": 1, "type": "string" }, { @@ -509,7 +661,7 @@ "items": { "anyOf": [ { - "pattern": "^[^\\\\]+$", + "minLength": 1, "type": "string" }, { @@ -521,13 +673,12 @@ } ], "default": [], - "description": "A list of files that should be excluded from binary relocation or False to ignore all binary files.", - "title": "Binary Relocation" + "description": "Secrets that are set as environment variables but never shown in the logs or the environment.", + "title": "Secrets" }, - "has_prefix_files": { + "content": { "anyOf": [ { - "pattern": "^[^\\\\]+$", "type": "string" }, { @@ -537,7 +688,6 @@ "items": { "anyOf": [ { - "pattern": "^[^\\\\]+$", "type": "string" }, { @@ -548,14 +698,77 @@ "type": "array" } ], - "default": [], - "description": "A list of files to force being detected as A TEXT file for prefix replacement.", - "title": "Has Prefix Files" + "description": "A string or list of strings that is the scripts contents", + "title": "Content" + } + }, + "required": [ + "content" + ], + "title": "ContentScript", + "type": "object" + }, + "DescriptionFile": { + "additionalProperties": false, + "properties": { + "file": { + "description": "Path in the source directory that contains the packages description. E.g. README.md", + "pattern": "^[^\\\\]+$", + "title": "File", + "type": "string" + } + }, + "required": [ + "file" + ], + "title": "DescriptionFile", + "type": "object" + }, + "DownstreamTestElement": { + "additionalProperties": false, + "properties": { + "downstream": { + "description": "Install the package and use the output of this package to test if the tests in the downstream package still succeed.", + "title": "Downstream", + "type": "string" + } + }, + "required": [ + "downstream" + ], + "title": "DownstreamTestElement", + "type": "object" + }, + "FileScript": { + "additionalProperties": false, + "properties": { + "interpreter": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The interpreter to use for the script.\n\nDefaults to `bash` on unix and `cmd.exe` on Windows.", + "title": "Interpreter" + }, + "env": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "the script environment.\n\nYou can use Jinja to pass through environments variables with the `env` object (e.g. `${{ env.get(\"MYVAR\") }}`)", + "title": "Env", + "type": "object" }, - "binary_has_prefix_files": { + "secrets": { "anyOf": [ { - "pattern": "^[^\\\\]+$", + "minLength": 1, "type": "string" }, { @@ -565,7 +778,7 @@ "items": { "anyOf": [ { - "pattern": "^[^\\\\]+$", + "minLength": 1, "type": "string" }, { @@ -577,14 +790,35 @@ } ], "default": [], - "description": "A list of files to force being detected as A BINARY file for prefix replacement.", - "title": "Binary Has Prefix Files" + "description": "Secrets that are set as environment variables but never shown in the logs or the environment.", + "title": "Secrets" }, - "ignore_prefix_files": { + "file": { "anyOf": [ { - "const": true + "pattern": "^[^\\\\]+$", + "type": "string" }, + { + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" + } + ], + "description": "The file to use as the script. Automatically adds the `bat` or `sh` to the filename on Windows or Unix respectively (if no file extension is given).", + "title": "File" + } + }, + "required": [ + "file" + ], + "title": "FileScript", + "type": "object" + }, + "GitBranch": { + "additionalProperties": false, + "properties": { + "patches": { + "anyOf": [ { "pattern": "^[^\\\\]+$", "type": "string" @@ -608,57 +842,78 @@ } ], "default": [], - "description": "A list of files that are not considered for prefix replacement, or True to ignore all files.", - "title": "Ignore Prefix Files" + "description": "A list of patches to apply after fetching the source", + "title": "Patches" }, - "detect_binary_files_with_prefix": { + "target_directory": { "anyOf": [ { - "type": "boolean" + "minLength": 1, + "type": "string" }, { "type": "null" } ], "default": null, - "description": "Wether to detect binary files with prefix or not. Defaults to True on Unix and False on Windows.", - "title": "Detect Binary Files With Prefix" + "description": "The location in the working directory to place the source", + "title": "Target Directory" }, - "skip_compile_pyc": { + "git": { "anyOf": [ { - "pattern": "^[^\\\\]+$", + "pattern": "/((git|ssh|http(s)?)|(git@[\\w\\.]+))(:(\\/\\/)?)([\\w\\.@\\:\\/\\-~]+)(\\.git)(\\/)?/igm", "type": "string" }, { - "$ref": "#/$defs/IfStatement" - }, + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" + } + ], + "description": "The url that points to the git repository.", + "title": "Git" + }, + "depth": { + "anyOf": [ { - "items": { - "anyOf": [ - { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "minimum": 0, + "type": "integer" }, { "type": "null" } ], "default": null, - "description": "A list of python files that should not be compiled to .pyc files at install time.", - "title": "Skip Compile Pyc" + "description": "A value to use when shallow cloning the repository.", + "title": "Depth" }, - "rpaths": { + "lfs": { + "default": false, + "description": "Should we LFS files be checked out as well", + "title": "Lfs", + "type": "boolean" + }, + "branch": { + "description": "Branch to check out", + "minLength": 1, + "title": "Branch", + "type": "string" + } + }, + "required": [ + "git", + "branch" + ], + "title": "GitBranch", + "type": "object" + }, + "GitRev": { + "additionalProperties": false, + "properties": { + "patches": { "anyOf": [ { - "minLength": 1, + "pattern": "^[^\\\\]+$", "type": "string" }, { @@ -668,7 +923,7 @@ "items": { "anyOf": [ { - "minLength": 1, + "pattern": "^[^\\\\]+$", "type": "string" }, { @@ -679,71 +934,79 @@ "type": "array" } ], - "default": [ - "lib/" - ], - "description": "A list of rpaths (Linux only).", - "title": "Rpaths" + "default": [], + "description": "A list of patches to apply after fetching the source", + "title": "Patches" }, - "script_env": { + "target_directory": { "anyOf": [ { - "$ref": "#/$defs/ScriptEnv" + "minLength": 1, + "type": "string" }, { "type": "null" } ], "default": null, - "description": "Environment variables to either pass through to the script environment or set." + "description": "The location in the working directory to place the source", + "title": "Target Directory" }, - "always_include_files": { + "git": { "anyOf": [ { - "minLength": 1, + "pattern": "/((git|ssh|http(s)?)|(git@[\\w\\.]+))(:(\\/\\/)?)([\\w\\.@\\:\\/\\-~]+)(\\.git)(\\/)?/igm", "type": "string" }, { - "$ref": "#/$defs/IfStatement" + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" + } + ], + "description": "The url that points to the git repository.", + "title": "Git" + }, + "depth": { + "anyOf": [ + { + "minimum": 0, + "type": "integer" }, { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "type": "null" } ], - "default": [], - "description": "Files to be included even if they are present in the PREFIX before building.", - "title": "Always Include Files" - }, - "osx_is_app": { - "default": false, - "title": "Osx Is App", - "type": "boolean" - }, - "disable_pip": { - "default": false, - "title": "Disable Pip", - "type": "boolean" + "default": null, + "description": "A value to use when shallow cloning the repository.", + "title": "Depth" }, - "preserve_egg_dir": { + "lfs": { "default": false, - "title": "Preserve Egg Dir", + "description": "Should we LFS files be checked out as well", + "title": "Lfs", "type": "boolean" }, - "force_use_keys": { + "rev": { + "description": "Revision to checkout to (hash or ref)", + "minLength": 1, + "title": "Rev", + "type": "string" + } + }, + "required": [ + "git", + "rev" + ], + "title": "GitRev", + "type": "object" + }, + "GitTag": { + "additionalProperties": false, + "properties": { + "patches": { "anyOf": [ { - "minLength": 1, + "pattern": "^[^\\\\]+$", "type": "string" }, { @@ -753,7 +1016,7 @@ "items": { "anyOf": [ { - "minLength": 1, + "pattern": "^[^\\\\]+$", "type": "string" }, { @@ -762,439 +1025,44 @@ ] }, "type": "array" + } + ], + "default": [], + "description": "A list of patches to apply after fetching the source", + "title": "Patches" + }, + "target_directory": { + "anyOf": [ + { + "minLength": 1, + "type": "string" }, { "type": "null" } ], "default": null, - "title": "Force Use Keys" + "description": "The location in the working directory to place the source", + "title": "Target Directory" }, - "force_ignore_keys": { + "git": { "anyOf": [ { - "minLength": 1, + "pattern": "/((git|ssh|http(s)?)|(git@[\\w\\.]+))(:(\\/\\/)?)([\\w\\.@\\:\\/\\-~]+)(\\.git)(\\/)?/igm", "type": "string" }, { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Force Ignore Keys" - }, - "merge_build_host": { - "default": false, - "title": "Merge Build Host", - "type": "boolean" - }, - "missing_dso_whitelist": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Missing Dso Whitelist" - }, - "runpath_whitelist": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Runpath Whitelist" - }, - "error_overdepending": { - "default": false, - "description": "Error on overdepending", - "title": "Error Overdepending", - "type": "boolean" - }, - "error_overlinking": { - "default": false, - "description": "Error on overlinking", - "title": "Error Overlinking", - "type": "boolean" - } - }, - "title": "Build", - "type": "object" - }, - "CommandTestElement": { - "additionalProperties": false, - "properties": { - "script": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - } - ], - "default": null, - "description": "A script to run to perform the test.", - "title": "Script" - }, - "extra_requirements": { - "anyOf": [ - { - "$ref": "#/$defs/TestElementRequires" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Additional dependencies to install before running the test." - }, - "files": { - "anyOf": [ - { - "$ref": "#/$defs/TestElementFiles" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Additional files to include for the test." - } - }, - "title": "CommandTestElement", - "type": "object" - }, - "ComplexPackage": { - "additionalProperties": false, - "properties": { - "name": { - "description": "The recipe name, this is only used to identify the name of the recipe.", - "title": "Name", - "type": "string" - }, - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The version of each output, this can be overwritten per output", - "title": "Version" - } - }, - "required": [ - "name" - ], - "title": "ComplexPackage", - "type": "object" - }, - "ComplexRecipe": { - "additionalProperties": false, - "properties": { - "context": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Defines arbitrary key-value pairs for Jinja interpolation", - "title": "Context" - }, - "source": { - "anyOf": [ - { - "$ref": "#/$defs/UrlSource" - }, - { - "$ref": "#/$defs/GitSource" - }, - { - "$ref": "#/$defs/LocalSource" - }, - { - "$ref": "#/$defs/IfStatement_Union_UrlSource__GitSource__LocalSource__" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/UrlSource" - }, - { - "$ref": "#/$defs/GitSource" - }, - { - "$ref": "#/$defs/LocalSource" - }, - { - "$ref": "#/$defs/IfStatement_Union_UrlSource__GitSource__LocalSource__" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The source items to be downloaded and used for the build.", - "title": "Source" - }, - "build": { - "anyOf": [ - { - "$ref": "#/$defs/Build" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Describes how the package should be build." - }, - "about": { - "anyOf": [ - { - "$ref": "#/$defs/About" - }, - { - "type": "null" - } - ], - "default": null, - "description": "A human readable description of the package information" - }, - "extra": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "description": "An set of arbitrary values that are included in the package manifest", - "title": "Extra" - }, - "recipe": { - "anyOf": [ - { - "$ref": "#/$defs/ComplexPackage" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The package version." - }, - "outputs": { - "anyOf": [ - { - "$ref": "#/$defs/Output" - }, - { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/Output" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - } - ], - "description": "A list of outputs that are generated for this recipe.", - "title": "Outputs" - } - }, - "required": [ - "outputs" - ], - "title": "ComplexRecipe", - "type": "object" - }, - "DescriptionFile": { - "additionalProperties": false, - "properties": { - "file": { - "description": "Path in the source directory that contains the packages description. E.g. README.md", - "pattern": "^[^\\\\]+$", - "title": "File", - "type": "string" - } - }, - "required": [ - "file" - ], - "title": "DescriptionFile", - "type": "object" - }, - "DownstreamTestElement": { - "additionalProperties": false, - "properties": { - "downstream": { - "description": "Install the package and use the output of this package to test if the tests in the downstream package still succeed.", - "title": "Downstream", - "type": "string" - } - }, - "required": [ - "downstream" - ], - "title": "DownstreamTestElement", - "type": "object" - }, - "GitSource": { - "additionalProperties": false, - "properties": { - "patches": { - "anyOf": [ - { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - } - ], - "default": [], - "description": "A list of patches to apply after fetching the source", - "title": "Patches" - }, - "folder": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The location in the working directory to place the source", - "title": "Folder" - }, - "git_rev": { - "default": "HEAD", - "description": "The git rev the checkout.", - "title": "Git Rev", - "type": "string" - }, - "git_url": { - "description": "The url that points to the git repository.", - "title": "Git Url", - "type": "string" - }, - "git_depth": { - "anyOf": [ + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" + } + ], + "description": "The url that points to the git repository.", + "title": "Git" + }, + "depth": { + "anyOf": [ { + "minimum": 0, "type": "integer" }, { @@ -1203,13 +1071,26 @@ ], "default": null, "description": "A value to use when shallow cloning the repository.", - "title": "Git Depth" + "title": "Depth" + }, + "lfs": { + "default": false, + "description": "Should we LFS files be checked out as well", + "title": "Lfs", + "type": "boolean" + }, + "tag": { + "description": "Tag to checkout", + "minLength": 1, + "title": "Tag", + "type": "string" } }, "required": [ - "git_url" + "git", + "tag" ], - "title": "GitSource", + "title": "GitTag", "type": "object" }, "IfStatement": { @@ -1328,7 +1209,7 @@ "title": "IfStatement[Union[CommandTestElement, ImportTestElement, DownstreamTestElement]]", "type": "object" }, - "IfStatement_Union_UrlSource__GitSource__LocalSource__": { + "IfStatement_Union_UrlSource__GitRev__GitTag__GitBranch__LocalSource__": { "properties": { "if": { "title": "If", @@ -1340,37 +1221,13 @@ "$ref": "#/$defs/UrlSource" }, { - "$ref": "#/$defs/GitSource" - }, - { - "$ref": "#/$defs/LocalSource" + "$ref": "#/$defs/GitRev" }, { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/UrlSource" - }, - { - "$ref": "#/$defs/GitSource" - }, - { - "$ref": "#/$defs/LocalSource" - } - ] - }, - "type": "array" - } - ], - "title": "Then" - }, - "else": { - "anyOf": [ - { - "$ref": "#/$defs/UrlSource" + "$ref": "#/$defs/GitTag" }, { - "$ref": "#/$defs/GitSource" + "$ref": "#/$defs/GitBranch" }, { "$ref": "#/$defs/LocalSource" @@ -1382,151 +1239,41 @@ "$ref": "#/$defs/UrlSource" }, { - "$ref": "#/$defs/GitSource" + "$ref": "#/$defs/GitRev" }, { - "$ref": "#/$defs/LocalSource" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Else" - } - }, - "required": [ - "if", - "then" - ], - "title": "IfStatement[Union[UrlSource, GitSource, LocalSource]]", - "type": "object" - }, - "ImportTestElement": { - "additionalProperties": false, - "properties": { - "imports": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" + "$ref": "#/$defs/GitTag" }, { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - } - ], - "description": "A list of Python imports to check after having installed the built package.", - "title": "Imports" - } - }, - "required": [ - "imports" - ], - "title": "ImportTestElement", - "type": "object" - }, - "LocalSource": { - "additionalProperties": false, - "properties": { - "patches": { - "anyOf": [ - { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "pattern": "^[^\\\\]+$", - "type": "string" + "$ref": "#/$defs/GitBranch" }, { - "$ref": "#/$defs/IfStatement" + "$ref": "#/$defs/LocalSource" } ] }, "type": "array" } ], - "default": [], - "description": "A list of patches to apply after fetching the source", - "title": "Patches" + "title": "Then" }, - "folder": { + "else": { "anyOf": [ { - "type": "string" + "$ref": "#/$defs/UrlSource" }, { - "type": "null" - } - ], - "default": null, - "description": "The location in the working directory to place the source", - "title": "Folder" - }, - "path": { - "description": "A path on the local machine that contains the source.", - "title": "Path", - "type": "string" - } - }, - "required": [ - "path" - ], - "title": "LocalSource", - "type": "object" - }, - "Output": { - "properties": { - "package": { - "anyOf": [ - { - "$ref": "#/$defs/ComplexPackage" + "$ref": "#/$defs/GitRev" }, { - "type": "null" - } - ], - "default": null, - "description": "The package name and version, this overwrites any top-level fields." - }, - "source": { - "anyOf": [ - { - "$ref": "#/$defs/UrlSource" + "$ref": "#/$defs/GitTag" }, { - "$ref": "#/$defs/GitSource" + "$ref": "#/$defs/GitBranch" }, { "$ref": "#/$defs/LocalSource" }, - { - "$ref": "#/$defs/IfStatement" - }, { "items": { "anyOf": [ @@ -1534,162 +1281,68 @@ "$ref": "#/$defs/UrlSource" }, { - "$ref": "#/$defs/GitSource" - }, - { - "$ref": "#/$defs/LocalSource" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The source items to be downloaded and used for the build.", - "title": "Source" - }, - "build": { - "anyOf": [ - { - "$ref": "#/$defs/OutputBuild" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Describes how the package should be build." - }, - "requirements": { - "anyOf": [ - { - "$ref": "#/$defs/Requirements" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The package dependencies" - }, - "test": { - "anyOf": [ - { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/CommandTestElement" - }, - { - "$ref": "#/$defs/ImportTestElement" + "$ref": "#/$defs/GitRev" }, { - "$ref": "#/$defs/DownstreamTestElement" + "$ref": "#/$defs/GitTag" }, { - "$ref": "#/$defs/IfStatement_Union_CommandTestElement__ImportTestElement__DownstreamTestElement__" + "$ref": "#/$defs/GitBranch" }, { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/CommandTestElement" - }, - { - "$ref": "#/$defs/ImportTestElement" - }, - { - "$ref": "#/$defs/DownstreamTestElement" - }, - { - "$ref": "#/$defs/IfStatement_Union_CommandTestElement__ImportTestElement__DownstreamTestElement__" - } - ] - }, - "type": "array" + "$ref": "#/$defs/LocalSource" } ] }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Tests to run after packaging", - "title": "Test" - }, - "about": { - "anyOf": [ - { - "$ref": "#/$defs/About" - }, - { - "type": "null" - } - ], - "default": null, - "description": "A human readable description of the package information. The values here are merged with the top level `about` field." - }, - "extra": { - "anyOf": [ - { - "type": "object" + "type": "array" }, { "type": "null" } ], "default": null, - "description": "An set of arbitrary values that are included in the package manifest. The values here are merged with the top level `extras` field.", - "title": "Extra" + "title": "Else" } }, - "title": "Output", + "required": [ + "if", + "then" + ], + "title": "IfStatement[Union[UrlSource, GitRev, GitTag, GitBranch, LocalSource]]", "type": "object" }, - "OutputBuild": { + "IgnoreRunExports": { "additionalProperties": false, "properties": { - "number": { + "by_name": { "anyOf": [ { - "minimum": 0, - "type": "integer" - }, - { - "pattern": "\\$\\{\\{.*\\}\\}", + "minLength": 1, "type": "string" }, { - "type": "null" - } - ], - "default": 0, - "description": "Build number to version current build in addition to package version", - "title": "Number" - }, - "string": { - "anyOf": [ - { - "type": "string" + "$ref": "#/$defs/IfStatement" }, { - "type": "null" + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" } ], - "default": null, - "description": "Build string to identify build variant (if not explicitly set, computed automatically from used build variant)", - "title": "String" + "default": [], + "description": "ignore run exports by name (e.g. `libgcc-ng`)", + "title": "By Name" }, - "skip": { + "from_package": { "anyOf": [ { "minLength": 1, @@ -1711,16 +1364,20 @@ ] }, "type": "array" - }, - { - "type": "null" } ], - "default": null, - "description": "List of conditions under which to skip the build of the package.", - "title": "Skip" - }, - "script": { + "default": [], + "description": "ignore run exports that come from the specified packages", + "title": "From Package" + } + }, + "title": "IgnoreRunExports", + "type": "object" + }, + "ImportTestElement": { + "additionalProperties": false, + "properties": { + "imports": { "anyOf": [ { "minLength": 1, @@ -1742,22 +1399,39 @@ ] }, "type": "array" + } + ], + "description": "A list of Python imports to check after having installed the built package.", + "title": "Imports" + } + }, + "required": [ + "imports" + ], + "title": "ImportTestElement", + "type": "object" + }, + "LinkOptions": { + "additionalProperties": false, + "properties": { + "post_link_script": { + "anyOf": [ + { + "minLength": 1, + "type": "string" }, { "type": "null" } ], "default": null, - "description": "Build script to be used. If not given, tries to find 'build.sh' on Unix or 'bld.bat' on Windows inside the recipe folder.", - "title": "Script" + "description": "Script to execute after the package has been linked into an environment", + "title": "Post Link Script" }, - "noarch": { + "pre_unlink_script": { "anyOf": [ { - "enum": [ - "generic", - "python" - ], + "minLength": 1, "type": "string" }, { @@ -1765,12 +1439,27 @@ } ], "default": null, - "description": "Can be either 'generic' or 'python'. A noarch 'python' package compiles .pyc files upon installation.", - "title": "Noarch" + "description": "Script to execute before uninstalling the package from an environment", + "title": "Pre Unlink Script" }, - "entry_points": { + "pre_link_message": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Message to show before linking", + "title": "Pre Link Message" + }, + "always_copy_files": { "anyOf": [ { + "minLength": 1, "type": "string" }, { @@ -1780,6 +1469,7 @@ "items": { "anyOf": [ { + "minLength": 1, "type": "string" }, { @@ -1788,21 +1478,23 @@ ] }, "type": "array" - }, - { - "type": "null" } ], - "default": null, - "description": "Only valid if `noarch: python` - list of all entry points of the package. e.g. `bsdiff4 = bsdiff4.cli:main_bsdiff4`", - "title": "Entry Points" - }, - "run_exports": { + "default": [], + "description": "Do not soft- or hard-link these files but instead always copy them into the environment", + "title": "Always Copy Files" + } + }, + "title": "LinkOptions", + "type": "object" + }, + "LocalSource": { + "additionalProperties": false, + "properties": { + "patches": { "anyOf": [ { - "$ref": "#/$defs/RunExports" - }, - { + "pattern": "^[^\\\\]+$", "type": "string" }, { @@ -1812,6 +1504,7 @@ "items": { "anyOf": [ { + "pattern": "^[^\\\\]+$", "type": "string" }, { @@ -1820,51 +1513,88 @@ ] }, "type": "array" + } + ], + "default": [], + "description": "A list of patches to apply after fetching the source", + "title": "Patches" + }, + "target_directory": { + "anyOf": [ + { + "minLength": 1, + "type": "string" }, { "type": "null" } ], "default": null, - "description": "Additional `run` dependencies added to a package that is build against this package.", - "title": "Run Exports" + "description": "The location in the working directory to place the source", + "title": "Target Directory" }, - "ignore_run_exports": { + "path": { + "description": "A path on the local machine that contains the source.", + "title": "Path", + "type": "string" + }, + "use_gitignore": { + "default": true, + "description": "Whether or not to use the .gitignore file when copying the source.", + "title": "Use Gitignore", + "type": "boolean" + }, + "file_name": { "anyOf": [ { "minLength": 1, "type": "string" }, { - "$ref": "#/$defs/IfStatement" - }, + "type": "null" + } + ], + "default": null, + "description": "A file name to rename the file to (does not apply to archives).", + "title": "File Name" + } + }, + "required": [ + "path" + ], + "title": "LocalSource", + "type": "object" + }, + "Output": { + "properties": { + "package": { + "anyOf": [ { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "$ref": "#/$defs/ComplexPackage" }, { "type": "null" } ], "default": null, - "description": "Ignore specific `run` dependencies that are added by dependencies in our `host` requirements section that have`run_exports`.", - "title": "Ignore Run Exports" + "description": "The package name and version, this overwrites any top-level fields." }, - "ignore_run_exports_from": { + "source": { "anyOf": [ { - "minLength": 1, - "type": "string" + "$ref": "#/$defs/UrlSource" + }, + { + "$ref": "#/$defs/GitRev" + }, + { + "$ref": "#/$defs/GitTag" + }, + { + "$ref": "#/$defs/GitBranch" + }, + { + "$ref": "#/$defs/LocalSource" }, { "$ref": "#/$defs/IfStatement" @@ -1873,8 +1603,19 @@ "items": { "anyOf": [ { - "minLength": 1, - "type": "string" + "$ref": "#/$defs/UrlSource" + }, + { + "$ref": "#/$defs/GitRev" + }, + { + "$ref": "#/$defs/GitTag" + }, + { + "$ref": "#/$defs/GitBranch" + }, + { + "$ref": "#/$defs/LocalSource" }, { "$ref": "#/$defs/IfStatement" @@ -1888,27 +1629,68 @@ } ], "default": null, - "description": "Ignore `run_exports` from the specified dependencies in our `host` section.`", - "title": "Ignore Run Exports From" + "description": "The source items to be downloaded and used for the build.", + "title": "Source" }, - "track_features": { + "build": { "anyOf": [ { - "minLength": 1, - "type": "string" + "$ref": "#/$defs/OutputBuild" }, { - "$ref": "#/$defs/IfStatement" + "type": "null" + } + ], + "default": null, + "description": "Describes how the package should be build." + }, + "requirements": { + "anyOf": [ + { + "$ref": "#/$defs/Requirements" }, + { + "type": "null" + } + ], + "default": null, + "description": "The package dependencies" + }, + "test": { + "anyOf": [ { "items": { "anyOf": [ { - "minLength": 1, - "type": "string" + "$ref": "#/$defs/CommandTestElement" }, { - "$ref": "#/$defs/IfStatement" + "$ref": "#/$defs/ImportTestElement" + }, + { + "$ref": "#/$defs/DownstreamTestElement" + }, + { + "$ref": "#/$defs/IfStatement_Union_CommandTestElement__ImportTestElement__DownstreamTestElement__" + }, + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/CommandTestElement" + }, + { + "$ref": "#/$defs/ImportTestElement" + }, + { + "$ref": "#/$defs/DownstreamTestElement" + }, + { + "$ref": "#/$defs/IfStatement_Union_CommandTestElement__ImportTestElement__DownstreamTestElement__" + } + ] + }, + "type": "array" } ] }, @@ -1919,179 +1701,129 @@ } ], "default": null, - "description": "deprecated, but still used to downweigh packages", - "title": "Track Features" - }, - "include_recipe": { - "default": true, - "description": "Whether or not to include the rendered recipe in the final package.", - "title": "Include Recipe", - "type": "boolean" + "description": "Tests to run after packaging", + "title": "Test" }, - "pre-link": { + "about": { "anyOf": [ { - "type": "string" + "$ref": "#/$defs/About" }, { "type": "null" } ], "default": null, - "description": "Script to execute when installing - before linking. Highly discouraged!", - "title": "Pre-Link" + "description": "A human readable description of the package information. The values here are merged with the top level `about` field." }, - "post-link": { + "extra": { "anyOf": [ { - "type": "string" + "type": "object" }, { "type": "null" } ], "default": null, - "description": "Script to execute when installing - after linking.", - "title": "Post-Link" - }, - "pre-unlink": { + "description": "An set of arbitrary values that are included in the package manifest. The values here are merged with the top level `extras` field.", + "title": "Extra" + } + }, + "title": "Output", + "type": "object" + }, + "OutputBuild": { + "additionalProperties": false, + "properties": { + "number": { "anyOf": [ { + "minimum": 0, + "type": "integer" + }, + { + "pattern": "\\$\\{\\{.*\\}\\}", "type": "string" }, { "type": "null" } ], - "default": null, - "description": "Script to execute when removing - before unlinking.", - "title": "Pre-Unlink" + "default": 0, + "description": "Build number to version current build in addition to package version", + "title": "Number" }, - "no_link": { + "string": { "anyOf": [ { - "pattern": "^[^\\\\]+$", "type": "string" }, { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" }, { "type": "null" } ], "default": null, - "description": "A list of files that are included in the package but should not be installed when installing the package.", - "title": "No Link" + "description": "The build string to identify build variant. This is usually omitted (can use `${{ hash }}`) variable here)", + "title": "String" }, - "binary_relocation": { + "skip": { "anyOf": [ - { - "const": false - }, - { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, { "items": { "anyOf": [ { - "pattern": "^[^\\\\]+$", "type": "string" }, { - "$ref": "#/$defs/IfStatement" + "type": "boolean" } ] }, "type": "array" + }, + { + "type": "null" } ], - "default": [], - "description": "A list of files that should be excluded from binary relocation or False to ignore all binary files.", - "title": "Binary Relocation" + "default": null, + "description": "List of conditions under which to skip the build of the package. If any of these condition returns true the build is skipped.", + "title": "Skip" }, - "has_prefix_files": { + "noarch": { "anyOf": [ { - "pattern": "^[^\\\\]+$", + "enum": [ + "generic", + "python" + ], "type": "string" }, { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "type": "null" } ], - "default": [], - "description": "A list of files to force being detected as A TEXT file for prefix replacement.", - "title": "Has Prefix Files" + "default": null, + "description": "Can be either 'generic' or 'python'. A noarch 'python' package compiles .pyc files upon installation.", + "title": "Noarch" }, - "binary_has_prefix_files": { + "script": { "anyOf": [ { - "pattern": "^[^\\\\]+$", "type": "string" }, { - "$ref": "#/$defs/IfStatement" + "$ref": "#/$defs/FileScript" }, { - "items": { - "anyOf": [ - { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - } - ], - "default": [], - "description": "A list of files to force being detected as A BINARY file for prefix replacement.", - "title": "Binary Has Prefix Files" - }, - "ignore_prefix_files": { - "anyOf": [ - { - "const": true + "$ref": "#/$defs/ContentScript" }, { - "pattern": "^[^\\\\]+$", + "minLength": 1, "type": "string" }, { @@ -2101,7 +1833,7 @@ "items": { "anyOf": [ { - "pattern": "^[^\\\\]+$", + "minLength": 1, "type": "string" }, { @@ -2110,57 +1842,33 @@ ] }, "type": "array" - } - ], - "default": [], - "description": "A list of files that are not considered for prefix replacement, or True to ignore all files.", - "title": "Ignore Prefix Files" - }, - "detect_binary_files_with_prefix": { - "anyOf": [ - { - "type": "boolean" }, { "type": "null" } ], "default": null, - "description": "Wether to detect binary files with prefix or not. Defaults to True on Unix and False on Windows.", - "title": "Detect Binary Files With Prefix" + "description": "The script to execute to invoke the build. If the string is a single line and ends with `.sh` or `.bat`, then we interpret it as a file.", + "title": "Script" }, - "skip_compile_pyc": { + "merge_build_and_host_envs": { "anyOf": [ { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" + "type": "boolean" }, { - "items": { - "anyOf": [ - { - "pattern": "^[^\\\\]+$", - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" }, { "type": "null" } ], - "default": null, - "description": "A list of python files that should not be compiled to .pyc files at install time.", - "title": "Skip Compile Pyc" + "default": false, + "description": "Merge the build and host environments (used in many R packages on Windows)", + "title": "Merge Build And Host Envs" }, - "rpaths": { + "always_include_files": { "anyOf": [ { "minLength": 1, @@ -2184,133 +1892,77 @@ "type": "array" } ], - "default": [ - "lib/" - ], - "description": "A list of rpaths (Linux only).", - "title": "Rpaths" + "default": [], + "description": "Files to be included even if they are present in the PREFIX before building.", + "title": "Always Include Files" }, - "script_env": { + "variant": { "anyOf": [ { - "$ref": "#/$defs/ScriptEnv" + "$ref": "#/$defs/Variant" }, { "type": "null" } ], "default": null, - "description": "Environment variables to either pass through to the script environment or set." + "description": "Options that influence how the different variants are computed." }, - "always_include_files": { + "python": { "anyOf": [ { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" + "$ref": "#/$defs/Python" }, { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "type": "null" } ], - "default": [], - "description": "Files to be included even if they are present in the PREFIX before building.", - "title": "Always Include Files" - }, - "osx_is_app": { - "default": false, - "title": "Osx Is App", - "type": "boolean" - }, - "disable_pip": { - "default": false, - "title": "Disable Pip", - "type": "boolean" - }, - "preserve_egg_dir": { - "default": false, - "title": "Preserve Egg Dir", - "type": "boolean" + "default": null, + "description": "Python specific build configuration" }, - "force_use_keys": { + "shared_libraries": { "anyOf": [ { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "$ref": "#/$defs/SharedLibraries" }, { "type": "null" } ], "default": null, - "title": "Force Use Keys" + "description": "Shared library specific build configuration" }, - "force_ignore_keys": { + "ignore_run_exports": { "anyOf": [ { - "minLength": 1, - "type": "string" + "$ref": "#/$defs/IgnoreRunExports" }, { - "$ref": "#/$defs/IfStatement" - }, + "type": "null" + } + ], + "default": null, + "description": "Ignore run-exports by name or from certain packages" + }, + "link_options": { + "anyOf": [ { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" + "$ref": "#/$defs/LinkOptions" }, { "type": "null" } ], "default": null, - "title": "Force Ignore Keys" + "description": "Options that influence how a package behaves when it is installed or uninstalled." }, - "merge_build_host": { + "cache_only": { "default": false, - "title": "Merge Build Host", + "description": "Do not output a package but use this output as an input to others.", + "title": "Cache Only", "type": "boolean" }, - "missing_dso_whitelist": { + "cache_from": { "anyOf": [ { "minLength": 1, @@ -2338,12 +1990,19 @@ } ], "default": null, - "title": "Missing Dso Whitelist" - }, - "runpath_whitelist": { + "description": "Take the output of the specified outputs and copy them in the working directory.", + "title": "Cache From" + } + }, + "title": "OutputBuild", + "type": "object" + }, + "Python": { + "additionalProperties": false, + "properties": { + "entry_points": { "anyOf": [ { - "minLength": 1, "type": "string" }, { @@ -2353,7 +2012,6 @@ "items": { "anyOf": [ { - "minLength": 1, "type": "string" }, { @@ -2362,33 +2020,39 @@ ] }, "type": "array" + } + ], + "default": [], + "title": "Entry Points" + }, + "use_python_app_entrypoint": { + "anyOf": [ + { + "type": "boolean" }, { - "type": "null" + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" } ], - "default": null, - "title": "Runpath Whitelist" - }, - "error_overdepending": { - "default": false, - "description": "Error on overdepending", - "title": "Error Overdepending", - "type": "boolean" - }, - "error_overlinking": { "default": false, - "description": "Error on overlinking", - "title": "Error Overlinking", - "type": "boolean" + "description": "Specifies if python.app should be used as the entrypoint on macOS. (macOS only)", + "title": "Use Python App Entrypoint" }, - "cache_only": { + "preserve_egg_dir": { + "anyOf": [ + { + "type": "boolean" + }, + { + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" + } + ], "default": false, - "description": "Do not output a package but use this output as an input to others.", - "title": "Cache Only", - "type": "boolean" + "title": "Preserve Egg Dir" }, - "cache_from": { + "skip_pyc_compilation": { "anyOf": [ { "minLength": 1, @@ -2410,17 +2074,27 @@ ] }, "type": "array" + } + ], + "default": [], + "description": "Skip compiling pyc for some files", + "title": "Skip Pyc Compilation" + }, + "disable_pip": { + "anyOf": [ + { + "type": "boolean" }, { - "type": "null" + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" } ], - "default": null, - "description": "Take the output of the specified outputs and copy them in the working directory.", - "title": "Cache From" + "default": false, + "title": "Disable Pip" } }, - "title": "OutputBuild", + "title": "Python", "type": "object" }, "Requirements": { @@ -2541,6 +2215,35 @@ "default": null, "description": "Constrained optional dependencies at runtime.", "title": "Run Constrained" + }, + "run_exports": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/$defs/RunExports" + } + ], + "default": null, + "description": "The run exports of this package", + "title": "Run Exports" } }, "title": "Requirements", @@ -2698,10 +2401,10 @@ "title": "RunExports", "type": "object" }, - "ScriptEnv": { + "SharedLibraries": { "additionalProperties": false, "properties": { - "passthrough": { + "rpaths": { "anyOf": [ { "minLength": 1, @@ -2725,20 +2428,48 @@ "type": "array" } ], - "default": [], - "description": "Environments variables to leak into the build environment from the host system. During build time these variables are recorded and stored in the package output. Use `secrets` for environment variables that should not be recorded.", - "title": "Passthrough" + "default": [ + "lib/" + ], + "description": "linux only, list of rpaths (was rpath)", + "title": "Rpaths" }, - "env": { - "additionalProperties": { - "type": "string" - }, - "default": {}, - "description": "Environment variables to set in the build environment.", - "title": "Env", - "type": "object" + "binary_relocation": { + "anyOf": [ + { + "type": "boolean" + }, + { + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" + }, + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + } + ], + "default": true, + "description": "Wether to relocate binaries or not. If this is a list of paths then only the listed paths are relocated", + "title": "Binary Relocation" }, - "secrets": { + "missing_dso_allowlist": { "anyOf": [ { "minLength": 1, @@ -2763,11 +2494,59 @@ } ], "default": [], - "description": "Environment variables to leak into the build environment from the host system that contain sensitve information. Use with care because this might make recipes no longer reproducible on other machines.", - "title": "Secrets" + "description": "Allow linking against libraries that are not in the run requirements", + "title": "Missing Dso Allowlist" + }, + "rpath_allowlist": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + } + ], + "default": [], + "description": "Allow runpath/rpath to point to these locations outside of the environment", + "title": "Rpath Allowlist" + }, + "overdepending_behavior": { + "default": "error", + "description": "What to do when detecting overdepending. Overdepending means that a requirement a run requirement is specified but none of the artifacts from the build link against any of the shared libraries of the requirement.", + "enum": [ + "ignore", + "error" + ], + "title": "Overdepending Behavior", + "type": "string" + }, + "overlinking_behavior": { + "default": "error", + "description": "What to do when detecting overdepending. Overlinking occurs when an artifact links against a library that was not specified in the run requirements.", + "enum": [ + "ignore", + "error" + ], + "title": "Overlinking Behavior", + "type": "string" } }, - "title": "ScriptEnv", + "title": "SharedLibraries", "type": "object" }, "SimplePackage": { @@ -2794,6 +2573,14 @@ "SimpleRecipe": { "additionalProperties": false, "properties": { + "schema_version": { + "default": 1, + "description": "The version of the YAML schema for a recipe. If the version is omitted it is assumed to be 1.", + "maximum": 1, + "minimum": 1, + "title": "Schema Version", + "type": "integer" + }, "context": { "anyOf": [ { @@ -2813,13 +2600,19 @@ "$ref": "#/$defs/UrlSource" }, { - "$ref": "#/$defs/GitSource" + "$ref": "#/$defs/GitRev" + }, + { + "$ref": "#/$defs/GitTag" + }, + { + "$ref": "#/$defs/GitBranch" }, { "$ref": "#/$defs/LocalSource" }, { - "$ref": "#/$defs/IfStatement_Union_UrlSource__GitSource__LocalSource__" + "$ref": "#/$defs/IfStatement_Union_UrlSource__GitRev__GitTag__GitBranch__LocalSource__" }, { "items": { @@ -2828,13 +2621,19 @@ "$ref": "#/$defs/UrlSource" }, { - "$ref": "#/$defs/GitSource" + "$ref": "#/$defs/GitRev" + }, + { + "$ref": "#/$defs/GitTag" + }, + { + "$ref": "#/$defs/GitBranch" }, { "$ref": "#/$defs/LocalSource" }, { - "$ref": "#/$defs/IfStatement_Union_UrlSource__GitSource__LocalSource__" + "$ref": "#/$defs/IfStatement_Union_UrlSource__GitRev__GitTag__GitBranch__LocalSource__" } ] }, @@ -3118,9 +2917,10 @@ "description": "A list of patches to apply after fetching the source", "title": "Patches" }, - "folder": { + "target_directory": { "anyOf": [ { + "minLength": 1, "type": "string" }, { @@ -3129,12 +2929,24 @@ ], "default": null, "description": "The location in the working directory to place the source", - "title": "Folder" + "title": "Target Directory" }, "url": { - "description": "The url that points to the source. This should be an archive that is extracted in the working directory.", - "title": "Url", - "type": "string" + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "items": { + "minLength": 1, + "type": "string" + }, + "type": "array" + } + ], + "description": "Rrl pointing to the source tar.gz|zip|tar.bz2|... (this can be a list of mirrors that point to the same file)", + "title": "Url" }, "sha256": { "anyOf": [ @@ -3167,6 +2979,20 @@ "default": null, "description": "The MD5 hash of the source archive", "title": "Md5" + }, + "file_name": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "A file name to rename the downloaded file to (does not apply to archives).", + "title": "File Name" } }, "required": [ @@ -3174,6 +3000,83 @@ ], "title": "UrlSource", "type": "object" + }, + "Variant": { + "additionalProperties": false, + "properties": { + "use_keys": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + } + ], + "default": [], + "description": "Keys to forcibly use for the variant computation (even if they are not in the dependencies)", + "title": "Use Keys" + }, + "ignore_keys": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + } + ], + "default": [], + "description": "Keys to forcibly ignore for the variant computation (even if they are in the dependencies)", + "title": "Ignore Keys" + }, + "down_prioritize_variant": { + "anyOf": [ + { + "type": "integer" + }, + { + "pattern": "\\$\\{\\{.*\\}\\}", + "type": "string" + } + ], + "default": 0, + "description": "used to prefer this variant less over other variants", + "title": "Down Prioritize Variant" + } + }, + "title": "Variant", + "type": "object" } }, "anyOf": [ @@ -3184,4 +3087,4 @@ "$ref": "#/$defs/ComplexRecipe" } ] -} \ No newline at end of file +}