From 9cd2012ad74353157d096e33f07a6630c5e7c464 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Tue, 14 Jul 2026 10:36:34 -0500 Subject: [PATCH 1/3] Add rattler-build recipe --- examples/5_02_pixi_build/compiled/recipe.yaml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 examples/5_02_pixi_build/compiled/recipe.yaml diff --git a/examples/5_02_pixi_build/compiled/recipe.yaml b/examples/5_02_pixi_build/compiled/recipe.yaml new file mode 100644 index 0000000..faf7612 --- /dev/null +++ b/examples/5_02_pixi_build/compiled/recipe.yaml @@ -0,0 +1,62 @@ +schema_version: 1 + +context: + version: 0.1.0 + +package: + name: rattler-collatz + version: ${{ version }} + +source: + url: https://github.com/scikit-build/SIMPLE-Py/archive/4e21e097e26365e403cb04f59abb73041cd3710c.tar.gz + # pixi global install curl openssl + # curl -sL | openssl sha256 + sha256: 75cf5fd9151a837a523eae5b3aa14094c2ac5cb93a22856237ef0c2700e49705 + +build: + number: 0 + script: + env: + CMAKE_GENERATOR: Ninja + content: + - ${{ PYTHON }} -m pip install examples/5_02_pixi_build/compiled -vv --no-deps --no-build-isolation + +requirements: + build: + - ${{ stdlib("c") }} + - ${{ compiler("cxx") }} + - cmake + - ninja + - if: build_platform != host_platform + then: + - cross-python_${{ host_platform }} + - python + host: + - python + - pip + - scikit-build-core + - pybind11 + run: + - python + +tests: + - python: + imports: + - collatz + pip_check: true + +about: + homepage: https://github.com/scikit-build/SIMPLE-Py + license: BSD-3-Clause + license_file: LICENSE + summary: Single-line summary of the package. + description: | + One or two paragraphs with more information about the package. + repository: https://github.com/scikit-build/SIMPLE-Py + documentation: https://github.com/scikit-build/SIMPLE-Py + +extra: + recipe-maintainers: + # GitHub username + - henryiii + - matthewfeickert From a73a2d3487a1db932db301f0fb7be731f7988e8f Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Tue, 14 Jul 2026 10:53:24 -0500 Subject: [PATCH 2/3] Add rattler-build example --- content/other-tools/02_pixi_build.md | 2 +- content/other-tools/03_conda_forge.md | 27 +++++++++++++++++++ examples/5_02_pixi_build/compiled/LICENSE | 21 +++++++++++++++ examples/5_02_pixi_build/compiled/recipe.yaml | 6 +++-- 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 examples/5_02_pixi_build/compiled/LICENSE diff --git a/content/other-tools/02_pixi_build.md b/content/other-tools/02_pixi_build.md index 4671f9d..b58b83a 100644 --- a/content/other-tools/02_pixi_build.md +++ b/content/other-tools/02_pixi_build.md @@ -228,7 +228,7 @@ pixi publish --clean --target-channel https://prefix.dev/ ## Compiled Packaging -Take the example Python package directory tree from [A minimal compiled package with scikit-build](https://scikit-build.org/SIMPLE-Py/compiled) as a starting foundation. +Take the example Python package directory tree from the [A minimal compiled package with scikit-build](https://scikit-build.org/SIMPLE-Py/compiled) section as a starting foundation. ```bash cp -R ./examples/2_01_package/collatz /tmp/compiled diff --git a/content/other-tools/03_conda_forge.md b/content/other-tools/03_conda_forge.md index f1834ea..31fa5eb 100644 --- a/content/other-tools/03_conda_forge.md +++ b/content/other-tools/03_conda_forge.md @@ -297,3 +297,30 @@ To get a conda recipe on conda-forge you need to submit it for build checks and When in doubt, just ask! The [conda-forge Zulip server](https://conda-forge.zulipchat.com/) is the best way to get responses from the community and the conda-forge/core team, but also make sure to [check out the maintainer knowledge base in the documentation](https://conda-forge.org/docs/maintainer/knowledge_base/) first. + +## rattler-build recipe build example + +Here is an valid `rattler-build` recipe for the `collatz` example from the [A minimal compiled package with scikit-build](https://scikit-build.org/SIMPLE-Py/compiled) section + +```{literalinclude} ../../examples/5_02_pixi_build/compiled/recipe.yaml +:filename: recipe.yaml +:linenos: +``` + +::::{exercise} Build the `rattler-build` recipe +:label: rattler-build-collatz + +Build the recipe file into a conda package with `rattler-build` and then inspect the package. + +:::{solution} rattler-build-collatz +:class: dropdown + +```bash +pixi global install rattler-build +rattler-build build --recipe . +rattler-build package inspect ./output/linux-64/rattler-collatz-*.conda +``` + +::: + +:::: diff --git a/examples/5_02_pixi_build/compiled/LICENSE b/examples/5_02_pixi_build/compiled/LICENSE new file mode 100644 index 0000000..4b06b60 --- /dev/null +++ b/examples/5_02_pixi_build/compiled/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 SIMPLE-Py + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/examples/5_02_pixi_build/compiled/recipe.yaml b/examples/5_02_pixi_build/compiled/recipe.yaml index faf7612..b9df265 100644 --- a/examples/5_02_pixi_build/compiled/recipe.yaml +++ b/examples/5_02_pixi_build/compiled/recipe.yaml @@ -19,11 +19,13 @@ build: env: CMAKE_GENERATOR: Ninja content: - - ${{ PYTHON }} -m pip install examples/5_02_pixi_build/compiled -vv --no-deps --no-build-isolation + - cd examples/5_02_pixi_build/compiled + - ${{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation requirements: build: - - ${{ stdlib("c") }} + # This is provided by conda-forge and so needs to be commented out for now. + # - ${{ stdlib("c") }} - ${{ compiler("cxx") }} - cmake - ninja From 67f1aea960a330f4f66e90761135def0c200af8e Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Tue, 14 Jul 2026 10:55:46 -0500 Subject: [PATCH 3/3] Add output to ignore --- examples/5_02_pixi_build/compiled/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/5_02_pixi_build/compiled/.gitignore b/examples/5_02_pixi_build/compiled/.gitignore index 06fa083..4ffc7c4 100644 --- a/examples/5_02_pixi_build/compiled/.gitignore +++ b/examples/5_02_pixi_build/compiled/.gitignore @@ -222,3 +222,4 @@ __marimo__/ .pixi/* !.pixi/config.toml pixi.lock +output/