diff --git a/crates/pixi_build_frontend/src/protocols/builders/rattler_build.rs b/crates/pixi_build_frontend/src/protocols/builders/rattler_build.rs index 2ef07ea32..becff6077 100644 --- a/crates/pixi_build_frontend/src/protocols/builders/rattler_build.rs +++ b/crates/pixi_build_frontend/src/protocols/builders/rattler_build.rs @@ -15,7 +15,6 @@ use crate::{ }; const DEFAULT_BUILD_TOOL: &str = "pixi-build-rattler-build"; -const DEFAULT_CHANNEL: &str = "https://prefix.dev/pixi-build-backends"; #[derive(Debug, Error, Diagnostic)] pub enum FinishError { diff --git a/examples/boltons/pixi.toml b/examples/boltons/pixi.toml index b1ddc2fd0..e3977bcd0 100644 --- a/examples/boltons/pixi.toml +++ b/examples/boltons/pixi.toml @@ -23,9 +23,8 @@ version = "0.1.0" [build-system] -build-backend = "pixi-build-rattler-build" +build-backend = { name = "pixi-build-rattler-build", version = "*"} channels = [ "https://repo.prefix.dev/pixi-build-backends", "https://fast.prefix.dev/conda-forge", -] -dependencies = ["pixi-build-rattler-build"] +] \ No newline at end of file diff --git a/examples/cpp-sdl/pixi.lock b/examples/cpp-sdl/pixi.lock index c8e70b59c..ff96123bc 100644 --- a/examples/cpp-sdl/pixi.lock +++ b/examples/cpp-sdl/pixi.lock @@ -111,7 +111,7 @@ packages: - libstdcxx >=14 - libgcc >=14 input: - hash: e15d918ba08c91b2a76a222f189538832b722b151ce7de1f26f6f3804107e401 + hash: e33768405651726cdb3c717da9527c7d4084414ac5b0cb1610e3510a585a7008 globs: - pixi.toml - conda: . @@ -122,7 +122,7 @@ packages: depends: - libcxx >=19 input: - hash: e15d918ba08c91b2a76a222f189538832b722b151ce7de1f26f6f3804107e401 + hash: e33768405651726cdb3c717da9527c7d4084414ac5b0cb1610e3510a585a7008 globs: - pixi.toml - conda: . @@ -133,7 +133,7 @@ packages: depends: - libcxx >=19 input: - hash: e15d918ba08c91b2a76a222f189538832b722b151ce7de1f26f6f3804107e401 + hash: e33768405651726cdb3c717da9527c7d4084414ac5b0cb1610e3510a585a7008 globs: - pixi.toml - conda: . @@ -145,7 +145,7 @@ packages: - vc >=14.1,<15 - vc14_runtime >=14.16.27033 input: - hash: e15d918ba08c91b2a76a222f189538832b722b151ce7de1f26f6f3804107e401 + hash: e33768405651726cdb3c717da9527c7d4084414ac5b0cb1610e3510a585a7008 globs: - pixi.toml - conda: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.22621.0-h57928b3_1.conda diff --git a/examples/cpp-sdl/pixi.toml b/examples/cpp-sdl/pixi.toml index 408f4e8d3..d980568a5 100644 --- a/examples/cpp-sdl/pixi.toml +++ b/examples/cpp-sdl/pixi.toml @@ -10,12 +10,11 @@ name = "sdl_example" version = "0.1.0" [build-system] -build-backend = "pixi-build-cmake" +build-backend = { name = "pixi-build-cmake", version = "*" } channels = [ "https://prefix.dev/pixi-build-backends", "https://prefix.dev/conda-forge", ] -dependencies = ["pixi-build-cmake"] [tasks.start] cmd = "sdl_example" diff --git a/examples/flask-hello-world/pixi.toml b/examples/flask-hello-world/pixi.toml index d5e573f68..6b38f2d44 100644 --- a/examples/flask-hello-world/pixi.toml +++ b/examples/flask-hello-world/pixi.toml @@ -16,9 +16,8 @@ name = "flask-hello-world" version = "0.1.0" [build-system] -build-backend = "pixi-build-python" +build-backend = { name = "pixi-build-python", version = "*" } channels = [ "https://fast.prefix.dev/pixi-build-backends", "https://fast.prefix.dev/conda-forge", ] -dependencies = ["pixi-build-python"] diff --git a/schema/model.py b/schema/model.py index c13cfaadb..d476e6c9c 100644 --- a/schema/model.py +++ b/schema/model.py @@ -238,17 +238,15 @@ class MatchspecTable(StrictBaseModel): # The Build section # ##################### class BuildSystem(StrictBaseModel): - channels: list[Channel] = Field( - None, - description="The `conda` channels that will be used to get build dependencies", - ) - dependencies: list[MatchSpec] = Field( - None, description="The dependencies for the build backend" - ) - build_backend: NonEmptyStr = Field(None, description="The build executable to call") + build_backend: BuildBackend = Field(..., description="The build backend to instantiate") channels: list[Channel] = Field( None, description="The `conda` channels that are used to fetch the build backend from" ) + additional_dependencies: Dependencies = Field(None, description="Additional dependencies to install alongside the build backend") + + +class BuildBackend(MatchspecTable): + name: NonEmptyStr = Field(None, description="The name of the build backend package") class _PyPIRequirement(StrictBaseModel): @@ -610,6 +608,7 @@ class Config: dependencies: Dependencies = DependenciesField host_dependencies: Dependencies = HostDependenciesField build_dependencies: Dependencies = BuildDependenciesField + run_dependencies: Dependencies = Field(None,description="The run-dependencies for the [package]") pypi_dependencies: dict[PyPIPackageName, PyPIRequirement] | None = Field( None, description="The PyPI dependencies" ) diff --git a/schema/schema.json b/schema/schema.json index 3d356dd1c..df7b014a1 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -158,6 +158,22 @@ "$ref": "#/$defs/PyPIOptions", "description": "Options related to PyPI indexes, on the default feature" }, + "run-dependencies": { + "title": "Run-Dependencies", + "description": "The run-dependencies for the [package]", + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "$ref": "#/$defs/MatchspecTable" + } + ] + } + }, "system-requirements": { "$ref": "#/$defs/SystemRequirements", "description": "The system requirements of the project" @@ -246,41 +262,139 @@ } } }, - "BuildSystem": { - "title": "BuildSystem", + "BuildBackend": { + "title": "BuildBackend", "type": "object", "additionalProperties": false, "properties": { - "build-backend": { - "title": "Build-Backend", - "description": "The build executable to call", + "branch": { + "title": "Branch", + "description": "A git branch to use", "type": "string", "minLength": 1 }, - "channels": { - "title": "Channels", - "description": "The `conda` channels that are used to fetch the build backend from", - "type": "array", - "items": { + "build": { + "title": "Build", + "description": "The build string of the package", + "type": "string", + "minLength": 1 + }, + "build-number": { + "title": "Build-Number", + "description": "The build number of the package, can be a spec like `>=1` or `<=10` or `1`", + "type": "string", + "minLength": 1 + }, + "channel": { + "title": "Channel", + "description": "The channel the packages needs to be fetched from", + "type": "string", + "minLength": 1, + "examples": [ + "conda-forge", + "pytorch", + "https://repo.prefix.dev/conda-forge" + ] + }, + "file-name": { + "title": "File-Name", + "description": "The file name of the package", + "type": "string", + "minLength": 1 + }, + "git": { + "title": "Git", + "description": "The git URL to the repo", + "type": "string", + "minLength": 1 + }, + "md5": { + "title": "Md5", + "description": "The md5 hash of the package", + "type": "string", + "pattern": "^[a-fA-F0-9]{32}$" + }, + "name": { + "title": "Name", + "description": "The name of the build backend package", + "type": "string", + "minLength": 1 + }, + "path": { + "title": "Path", + "description": "The path to the package", + "type": "string", + "minLength": 1 + }, + "rev": { + "title": "Rev", + "description": "A git SHA revision to use", + "type": "string", + "minLength": 1 + }, + "sha256": { + "title": "Sha256", + "description": "The sha256 hash of the package", + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$" + }, + "subdir": { + "title": "Subdir", + "description": "The subdir of the package, also known as platform", + "type": "string", + "minLength": 1 + }, + "tag": { + "title": "Tag", + "description": "A git tag to use", + "type": "string", + "minLength": 1 + }, + "url": { + "title": "Url", + "description": "The URL to the package", + "type": "string", + "minLength": 1 + }, + "version": { + "title": "Version", + "description": "The version of the package in [MatchSpec](https://github.com/conda/conda/blob/078e7ee79381060217e1ec7f9b0e9cf80ecc8f3f/conda/models/match_spec.py) format", + "type": "string", + "minLength": 1 + } + } + }, + "BuildSystem": { + "title": "BuildSystem", + "type": "object", + "required": [ + "build-backend" + ], + "additionalProperties": false, + "properties": { + "additional-dependencies": { + "title": "Additional-Dependencies", + "description": "Additional dependencies to install alongside the build backend", + "type": "object", + "additionalProperties": { "anyOf": [ { "type": "string", "minLength": 1 }, { - "type": "string", - "format": "uri", - "minLength": 1 - }, - { - "$ref": "#/$defs/ChannelInlineTable" + "$ref": "#/$defs/MatchspecTable" } ] } }, - "dependencies": { - "title": "Dependencies", - "description": "The dependencies for the build backend", + "build-backend": { + "$ref": "#/$defs/BuildBackend", + "description": "The build backend to instantiate" + }, + "channels": { + "title": "Channels", + "description": "The `conda` channels that are used to fetch the build backend from", "type": "array", "items": { "anyOf": [ @@ -289,7 +403,12 @@ "minLength": 1 }, { - "$ref": "#/$defs/MatchspecTable" + "type": "string", + "format": "uri", + "minLength": 1 + }, + { + "$ref": "#/$defs/ChannelInlineTable" } ] }