Conversation
Following the suggestions given in the previous PEP 817 thread [1], we have decided to split PEP 817 into a series of smaller PEPs, with the hope that this will make it easier to comprehend the concept and discuss it. This is the first split PEP, that specifically focuses on the low-level details necessary for variants wheels to work, that is: - adding variant label to the filename - storing variant properties in the file - exposing variants on the index - ordering/selecting variants - introducing variant-conditional dependencies via environment markers - exposing variant wheels in `pylock.toml` The PEP keeps variant properties abstract, deferring their governance and determining their compatibility to a subsequent PEP, along with building wheels. We've also significantly cut motivation down (the original is kept in PEP 817 for reference). We've tried to make the "specification" part easier to comprehend, and removed the duplicate "rationale-overview", in favor of a more focused "rationale" section. Compared to the previous iteration of PEP 817, we've also corrected the variant ordering algorithm to handle corner cases better. [1] https://discuss.python.org/t/pep-817-wheel-variants-beyond-platform-tags/105860 Signed-off-by: Michał Górny <mgorny@quansight.com> Co-authored-by: Jonathan Dekhtiar <jonathan@dekhtiar.com> Co-authored-by: Konstantin Schütze <konstin@mailbox.org> Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
|
@warsaw or @dstufft Please can one of you confirm co-authorship? @DEKHTIARJonathan Note: we assign PEP number after core team co-authorship/sponsorship is confirmed :) @mgorny There's a checklist at https://github.com/python/peps/blob/main/.github/PULL_REQUEST_TEMPLATE/Add%20a%20new%20PEP.md you might find useful to paste into the top message and check off as relevant. |
96768ab to
8bd58c4
Compare
|
Yes. Sent from my iPhoneOn Feb 17, 2026, at 14:18, Jonathan DEKHTIAR ***@***.***> wrote:DEKHTIARJonathan left a comment (python/peps#4819)
@hugovk @dstufft just told me to grab the next number available.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
Thanks, please go ahead with 825! Remember the CODEOWNERS file. |
|
Done. Thanks Hugo |
Ah, sorry, I wonder why GH didn't include it in the box. |
| @@ -0,0 +1,962 @@ | |||
| PEP: 825 | |||
There was a problem hiding this comment.
General suggestion for all this PEP splitting work, there are some optional headers that might be useful for cross linking:
Requires: *[NNN]
Replaces: *[NNN]
Superseded-By: *[NNN]
There was a problem hiding this comment.
These headers do not apply to this specific PEP. We will probably update very soon 817 to include Requires: [817, and_others_not_yet_published]
If that works for you, we can close this one
Not your fault, GitHub has only partially implemented the feature: the option to use a template only shows up when you click to open the PR via the website UI, and not for example via the link you get when pushing from the CLI (which is my usual route of opening a PR). 🤷 |
| # {namespace: {feature_name: [feature_values]}}, as in variant.json | ||
| properties: dict[str, dict[str, list[str]]] | ||
| def best_value_properties(self) -> tuple[str, str, str]: |
There was a problem hiding this comment.
| def best_value_properties(self) -> tuple[str, str, str]: | |
| def best_value_properties(self) -> list[tuple[str, str, str]]: |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
|
|
||
| "variants": { | ||
| // REQUIRED: in variant.json, always a single entry, with the key | ||
| // matching the variant label ("x8664v3_openblas") and the value |
There was a problem hiding this comment.
the lack of separators here is a bit jarring. The numpy example for the introduction of variant labels has x86_64_v3; is there any reason this couldn't be:
| // matching the variant label ("x8664v3_openblas") and the value | |
| // matching the variant label ("x86_64_v3_openblas") and the value |
This occurs in the same way in several example further down, so I must assume it's intentional, but I don't understand why that cramped style was chosen. Plus it's not consistent with also using x86_64_v3 in other places.
There was a problem hiding this comment.
Label can be up to 16 characters long, and anyway it's just an example.
There was a problem hiding this comment.
If the PEP itself already runs into this limitation (without a contrived example)
>>> len("x8664v3_openblas")
16
it sounds like 16 is too short? The Variant Label section does not provide a rationale for that length either. What constraint (aside from avoiding superlong wheel names) was this limit chosen for?
(PS. Happy to move this to discourse; I initially had thought this was just on the level of a typo fix, but it might need wider discussion)
|
There was a suggestion of reserving a series of PEP numbers for this work. |
One of the issues is that we are not sure how many PEPs we will end up "cutting into". It would be nice to have but realistically it's not the end of the world if we don't also. @hugovk if we were to "reserve and block" 825-830 right now. How would we do that ? What's the criteria to make it happen ? |
|
Given that 817 and 825 are already somewhat disjoint, it's not the end of the world if you don't get a series. But OTOH, it's also not difficult, since it's Just Numbers 😄. I think if you had a clearer sense of wanting X PEPs you could reserve a block of those X numbers. It also wouldn't be terrible if you end up using X-N because those extras could be "released" for other proposals. Harder is if you need X+N because those will already be assigned and renumbering isn't going to work. |
| if both variants have the same number of keys, they are ordered | ||
| lexically by their variant label, ascending. This is done by the | ||
| ultimate step of the example algorithm, with the comparison function | ||
| being implemented as ``VariantWheel.__lt__()``. |
|
|
||
|
|
||
| # 7. Order variants by comparing their sorted properties | ||
| # (see VariantWheel.__lt__()) |
Basic requirements (all PEP Types)
pep-NNNN.rst), PR title (PEP 123: <Title of PEP>) andPEPheaderAuthororSponsor, and formally confirmed their approvalAuthor,Status(Draft),TypeandCreatedheaders filled out correctlyPEP-Delegate,Topic,RequiresandReplacesheaders completed if appropriate.github/CODEOWNERSfor the PEPStandards Track requirements
Python-Versionset to valid (pre-beta) future Python version, if relevantDiscussions-ToandPost-HistoryFollowing the suggestions given in the previous PEP 817 thread [1], we have decided to split PEP 817 into a series of smaller PEPs, with the hope that this will make it easier to comprehend the concept and discuss it.
This is the first split PEP, that specifically focuses on the low-level details necessary for variants wheels to work, that is:
pylock.tomlThe PEP keeps variant properties abstract, deferring their governance and determining their compatibility to a subsequent PEP, along with building wheels. We've also significantly cut motivation down (the original is kept in PEP 817 for reference). We've tried to make the "specification" part easier to comprehend, and removed the duplicate "rationale-overview", in favor of a more focused "rationale" section.
Compared to the previous iteration of PEP 817, we've also corrected the variant ordering algorithm to handle corner cases better.
[1] https://discuss.python.org/t/pep-817-wheel-variants-beyond-platform-tags/105860
📚 Documentation preview 📚: https://pep-previews--4819.org.readthedocs.build/pep-0825/