Skip to content

gh-152384: pixi-packages: use flags to define variants - #152385

Merged
kumaraditya303 merged 16 commits into
python:mainfrom
lucascolley:pixi-flags
Jul 17, 2026
Merged

gh-152384: pixi-packages: use flags to define variants#152385
kumaraditya303 merged 16 commits into
python:mainfrom
lucascolley:pixi-flags

Conversation

@lucascolley

@lucascolley lucascolley commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

- `freethreading`
- `asan`: ASan-instrumented build
- `tsan-freethreading`: TSan-instrumented free-threading build
- `tsan_freethreading`: TSan-instrumented free-threading build

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it makes sense to remove the - from this variant name, given that it is invalid in the flags field: https://conda.org/learn/ceps/cep-0045#repodata-record-syntax

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems fine to me, I think you and @crusaderky are just about the only users of these builds so far for what its worth

Comment on lines 84 to 88
run_exports:
noarch:
- python
weak:
- python_abi ${{ version }}.* *_${{ abi_tag }}

@lucascolley lucascolley Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we could also define flags on python_abi and perhaps not need to rely on abi_tag as much? But I suppose we still want to keep abi_tag around at least while conda-forge does?

EDIT: can probably leave this for a follow-up and open an issue

@lucascolley

Copy link
Copy Markdown
Contributor Author

@StanFromIreland this goes some way towards making the version update situation better by reducing duplication in the variant definition

Comment on lines +3 to +4
openssl:
- '3.5'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

obviously you could download the current pinning file, yaml-load it and extract the openssl pin, but that's perhaps more complexity and dynamism than justified - an argument could be made that openssl is special enough to handle it separately... and although pins have a habit of going stale, staying on an LTS version probably makes sense here.

conda-forge will probably migrate to openssl 4 in the fall, but since AFAICT python has no other dependencies that are themselves openssl-dependent, this should not cause any conflicts (except in larger environments with the most recent builds, but that's not really relevant for the ASAN stuff).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

obviously you could download the current pinning file, yaml-load it and extract the openssl pin, but that's perhaps more complexity and dynamism than justified

an idea was floated at some point that variant configs themselves could be packaged as conda packages and Pixi could consume them that way. Not sure if anyone has thought about that recently.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I mean, conda-forge-pinning is exactly that package. You'd still have to go parse the yaml though. 🤷

Comment thread Tools/pixi-packages/README.md Outdated
@ngoldbaum

Copy link
Copy Markdown
Contributor

The CI failure looks unrelated but before this PR can be merged it's going to need a NEWS entry. Can you add one?

@hugovk

hugovk commented Jul 10, 2026

Copy link
Copy Markdown
Member

I've updated this branch from main, which should pull in a skip for the failing unrelated macOS test.

@lucascolley
lucascolley requested a review from ngoldbaum July 10, 2026 13:39
@lucascolley

Copy link
Copy Markdown
Contributor Author

news added

Comment thread Tools/pixi-packages/variants.yaml
@lucascolley

Copy link
Copy Markdown
Contributor Author

@ngoldbaum @kumaraditya303 any remaining concerns from your side? I think we can merge and patch up any more changes in a follow-up, this seems to be an improvement on the situation in main at least :)

Comment thread Tools/pixi-packages/variants.yaml Outdated
Co-authored-by: Isuru Fernando <isuruf@gmail.com>
Comment thread Tools/pixi-packages/recipe.yaml Outdated
@lucascolley

Copy link
Copy Markdown
Contributor Author

@ngoldbaum @hugovk I believe this is ready for a final look!

Comment thread Tools/pixi-packages/build.sh Outdated

@ngoldbaum ngoldbaum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Other than the issue with the error message, LGTM!

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Comment thread Tools/pixi-packages/build.sh Outdated
@kumaraditya303

Copy link
Copy Markdown
Contributor

This looks good, I'll merge it now to unblock other stuff.

@kumaraditya303
kumaraditya303 merged commit 2931f20 into python:main Jul 17, 2026
55 checks passed
@hugovk

hugovk commented Jul 17, 2026

Copy link
Copy Markdown
Member

How far do we want to backport this? Or just main for now?

I generally prefer to have less diverse config across branches, as it makes it harder to maintain.

@rgommers

Copy link
Copy Markdown
Contributor

Either way works I think, it shouldn't break anything to backport. Both because it's still very new with only a few users, and because the main way of using it is to point at an exact commit hash in a downstream pixi.toml; in SciPy CI we're pointing at commits on main.

@lucascolley
lucascolley deleted the pixi-flags branch July 17, 2026 08:19
@lucascolley

Copy link
Copy Markdown
Contributor Author

a backport to 3.15 would be nice, however https://github.com/python/cpython/blob/main/Tools/pixi-packages/variants.yaml#L1 will need a tweak

@lucascolley

Copy link
Copy Markdown
Contributor Author

a backport to 3.15 would be nice, however main/Tools/pixi-packages/variants.yaml#L1 will need a tweak

hey @hugovk, any chance of a backport?

@hugovk hugovk added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 2, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @lucascolley for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Aug 2, 2026

Copy link
Copy Markdown

GH-155091 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 2, 2026
@hugovk

hugovk commented Aug 2, 2026

Copy link
Copy Markdown
Member

Sure, how does #155091 look?

hugovk added a commit that referenced this pull request Aug 2, 2026
…52385) (#155091)

* gh-152384: pixi-packages: use `flags` to define variants (GH-152385)
(cherry picked from commit 2931f20)

Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Isuru Fernando <isuruf@gmail.com>
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>

* version: ["3.15"]

---------

Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Isuru Fernando <isuruf@gmail.com>
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants