Is this even possible to have different wheels for different platforms for a given python package fetched from two different pypi server?
07/05/2022, 4:12 PM
I think that should work? Are you seeing otherwise?
07/05/2022, 4:14 PM
I haven't tried it properly yet. So PEX should figure it out itself when generating locakfile as long as I provide correct extra Index url? Or do I need to do something else?
07/05/2022, 5:08 PM
I think so, @enough-analyst-54434 will know for sure
07/05/2022, 5:13 PM
I have no clue actually. This boils down to what Pip does and I'm not sure. I agree that it should search all indexes and not stop short, but you could imagine it stops short if it has found a resolve solution; so - try it out and please let us know what you find!
However, if Pip does stop short, you can use a trick: For each wheel you need from your alternate index, instead of add that index, add a requirement on the wheel URL with an environment marker tacked on the end to make sure that wheel is only used when needed. Like so in a requirements.txt:
foo==1.8 # The normal requirement where most wheels are on PyPI
foo @ <https://my/index/foo-1.8-X-Y-Z.whl>; sys_platform = "linux"'
foo @ <https://my/index/foo-1.8-A-B-C.whl>; sys_platform = "darwin"'
... etc ...
This is an untested trick, so I may have some spelling wrong, but the idea should definitely work.
07/14/2022, 8:35 AM
So fetching wheels from different pypi server works as long as there is no duplicate. We fetch M1 wheels from private pypi and the rest from public one.