Skip to content

Port v1 recipe support to py-rattler-build#5924

Open
jsmolic wants to merge 29 commits intoconda:mainfrom
jsmolic:v1-integration-py-rattler
Open

Port v1 recipe support to py-rattler-build#5924
jsmolic wants to merge 29 commits intoconda:mainfrom
jsmolic:v1-integration-py-rattler

Conversation

@jsmolic
Copy link
Copy Markdown
Contributor

@jsmolic jsmolic commented Feb 17, 2026

Closes: #5891
Closes: #5892
Closes: #5893

Description

This PR continues the work started in #5880 replacing the rattler-build CLI subprocess calls with the new py-rattler API.

It currently supports rendering and building v1 packages. Support for conda-debug was removed due to issues with the debug API; which has since been refactored in py-rattler and will be integrated in a subsequent PR to reduce the complexity in this one.

Py-rattler API documentation is available here, but this summary describes how the API is used within this PR for easier review:

  • The logic for finding rattler-build binary has been removed as we are no longer using the CLI tool.
  • Core functionality of the code is in run_rattler() and process_recipe() functions.
  • run_rattler() initializes configuration variables based on the values stored in argparse.Namespace and Config objects. It delegates recipe processing to a separate function and handles the build summary reporting at the end.
  • Configuration file discovery logic has remained largely unchanged from the previous version
  • Most of the rattler-build general settings are now handled through ToolConfiguration, while PlatformConfig and RenderConfig define platform-specific settings and rendering behavior, respectively.
  • Configuration files are loaded using VariantConfig.from_file() method, respecting the order in which they are stacked.

process_recipes() performs loading, rendering, build and testing the recipe. Recipes are loaded with Stage0Recipe.from_file(), rendered with recipe.render() and build with variant.run_build(). If enabled, testing runs after the build to follow v0 recipe behavior in conda-build.

Progress reporting

Py-rattler uses the ProgressCallback protocol for progress reporting, with some built-in implementations and options to define custom callbacks. This PR integrates SimpleProgressCallback and forwards the event levels and messages to conda’s logging system. This implementation is minimal but additional UI improvements are expected to be added in future versions.

Build results and summary

Build results are stored in dataclasses that contain recipe and output info about build status and error messages. Each process_recipe() call returns a RecipeResult object containing all relevant build summary details. Short summary is displayed upon completion, displaying per-recipe and per-output build results along with any errors if present.

Limitations/features currently not implemented:

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@github-project-automation github-project-automation bot moved this to 🆕 New in 🔎 Review Feb 17, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Feb 17, 2026
@jaimergp jaimergp linked an issue Feb 17, 2026 that may be closed by this pull request
2 tasks
@jsmolic jsmolic force-pushed the v1-integration-py-rattler branch 2 times, most recently from 9ffa6ce to db7d96e Compare February 23, 2026 01:18
@jsmolic jsmolic requested a review from jaimergp February 25, 2026 16:05
@jsmolic jsmolic force-pushed the v1-integration-py-rattler branch 3 times, most recently from c4a2035 to 25d657f Compare February 27, 2026 15:57
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 4, 2026

Merging this PR will not alter performance

✅ 5 untouched benchmarks


Comparing jsmolic:v1-integration-py-rattler (5655d49) with main (805bc5f)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (26ac205) during the generation of this report, so 805bc5f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@jsmolic jsmolic force-pushed the v1-integration-py-rattler branch 5 times, most recently from 351d00f to 4fc24f5 Compare March 4, 2026 14:44
Copy link
Copy Markdown
Contributor

@jaimergp jaimergp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments about docstrings and default values, and I'm also curious about failure modes.

@jsmolic jsmolic force-pushed the v1-integration-py-rattler branch 4 times, most recently from 03910f9 to b01a62c Compare March 9, 2026 01:00
jsmolic added 29 commits April 7, 2026 20:50
issues

rattler-build debug support has been dropped in
prefix-dev/rattler-build@c607abf
due to the awkward implementation. It is going to be implemented
properly with the new API so we can readd debug support once the code
will make it into rattler-build source.
It has been suggested that moving these definitions out of
process_recipes function makes more sense. The drawback is that we won't
be able to support the experimental staging outputs because we need to
be inspect outputs after loading the recipe file. This should be
documented as a limitation of the current implementation. Once the
staging outputs are properly supported in rattler-build we can come back
and implement this in conda-build.
We are going to initially simply fork py-rattler-build's progress
callback and pass the level and messages to conda's logging
We can't use it in py-rattler-build to increase verbosity
py-rattler-build does not auto discover recipe variants so we don't need
to anything about this
Use py-rattler-build's Package API to run the tests. Use the test output
to report it back when tests fail in the build summary.
- This adds the initial v1 recipes test file
This commit adds dataclasses for easier storing and reporting recipe and
output build results. We can use them to store info during the build
process such as recipe/output name, success status and error message if
any; and use it to re-raise CondaBuildUserError in the end and report a
meaningful build summary.
@jsmolic jsmolic force-pushed the v1-integration-py-rattler branch from c9bcb9d to 5655d49 Compare April 7, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🆕 New

5 participants