Skip to content

feat(pixi-build-rattler-build): add context variable#5785

Open
toprinse wants to merge 5 commits intoprefix-dev:mainfrom
toprinse:add_version_env_variable
Open

feat(pixi-build-rattler-build): add context variable#5785
toprinse wants to merge 5 commits intoprefix-dev:mainfrom
toprinse:add_version_env_variable

Conversation

@toprinse
Copy link
Copy Markdown
Contributor

@toprinse toprinse commented Mar 27, 2026

Description

This PR is motivated by the fact that, using pixi-rattler-build-backend requires to specify package version in the recipe.yaml rather than into the pixi.toml. So the idea is to add a context variable that can use the version given in the pixi.toml and propagate it into the recipe using PIXI_PACKAGE_VERSION jinja variable.

Before change

in recipe.yml :

context:
  version: 1.2.0

and in pixi.toml:

[package]
name    = "cpp_math"
version = "1.2.0"

Then, after changes :
in recipe.yml :

context:
  version: ${{ PIXI_PACKAGE_VERSION }}

and in pixi.toml:

[package]
name    = "cpp_math"
version = "1.2.0"

Closes #5782

How Has This Been Tested?

  • Tested using the cpp_math example refactored for multi-ouptut processing with nanobind (cpp_math.zip)

  • Tested using local built pixi executable and PIXI_BUILD_BACKEND_OVERRIDE to use local built build-backend

PIXI_BUILD_BACKEND_OVERRIDE="pixi-build-rattler-build=local-path-build-backend"  && \
./pixi build --path path_to_cpp_math
  • Unit test for the inject_pixi_version_into_context function

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
      Tools: Github Copilot on Claude Sonnet 4.6

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.

@toprinse toprinse force-pushed the add_version_env_variable branch from 2c5dc3b to 59f24b1 Compare March 30, 2026 07:13
@lucascolley lucascolley changed the title feat: Add Context variable for rattler-build-backend feat(pixi-build-rattler-build): add context variable Apr 24, 2026
@lucascolley lucascolley added enhancement New features area:build Related to pixi build pixi-build-rattler-build Issues related to pixi-build-rattler-build. labels Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build Related to pixi build enhancement New features pixi-build-rattler-build Issues related to pixi-build-rattler-build.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(pixi-build-rattler-build): expose package version from manifest to recipe

2 participants