# Selecting variant wheels according to a semi-static specification

**URL:** <https://discuss.python.org/t/selecting-variant-wheels-according-to-a-semi-static-specification/53446>\
**Category:** Packaging\
**Created:** [May 15, 2024, 9:38pm UTC](https://discuss.python.org/t/selecting-variant-wheels-according-to-a-semi-static-specification/53446 "2024-05-15T21:38:47Z")\
**Posts on this page:** 1\
**Showing post:** 116

<div class="post-metadata">

**Author:** ![pf\_moore](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pf_moore/32/35_2.png) [@pf\_moore](https://discuss.python.org/u/pf_moore)\
**Post date:** [August 8, 2024, 9:20am UTC](https://discuss.python.org/t/selecting-variant-wheels-according-to-a-semi-static-specification/53446/116 "2024-08-08T09:20:34Z")

</div>

> [@brettcannon](#):
>
> I don’t know who the PEP delegate for this who would give the final say, but I would say I would expect to have the PEP cover how the installer is expected to determine what to install, otherwise it’s just info that no one quite knows how to use.

Speaking as a pip maintainer I definitely _would_ want a PEP if the design required imposing a priority order on indexes. Moreover, now that `uv` exists, “installer behaviour” is very much something that can only be relied on if there’s a PEP standardising it. (That always was the case, but people used to assume that if pip did something, that was good enough in spite of us reminding them that it wasn’t 🙁).

Speaking as a potential PEP delegate, if the PEP doesn’t specify the behaviour precisely enough for it to be implemented in pip without “hidden” implications like this, then the PEP isn’t sufficiently detailed, and I’d want that fixed.

> [@msarahan](#):
>
> I believe I’ll run into the [`--extra-index-url` priority issue](https://github.com/pypa/pip/issues/9610) ([also](https://github.com/pypa/pip/issues/8606)), because my design effectively treats each variant as a different index url, and I’d definitely need priority for considering more preferred variants first

To put what I said above another way, any design that involves having two different index URLs serve the same filename with different content, is extremely unlikely to get accepted. This would break a lot of code, including caching algorithms based on the wheel filename.

Basically, don’t assume that adding index priority to pip will be acceptable. The issues you linked to give some sense of how complex the whole matter is, and either you need to address all of that complexity (good luck!) or you’re going to add a special case that implements index priority in just _one_ part of pip, and that’s going to be a maintenance nightmare.

In all honesty, if you want to go down this route, I’d want a _separate_ PEP, entitled something like “Selecting Python package files across multiple sources”, which defined standard behaviour required of _all_ installers and consumers of data from package indexes. It would need to integrate with [PEP 708](https://www.python.org/dev/peps/pep-0708/)\[1\] as well, which is how we currently handle this issue. The variant wheel PEP would then depend on the guarantees provided by that other PEP.

* * *

1. which is (provisionally) accepted, but still hasn’t been implemented in the ecosystem - so there’s that, as well 🙁

---

_[View the full topic](https://discuss.python.org/t/selecting-variant-wheels-according-to-a-semi-static-specification/53446)._
