Is this even possible to have different wheels for...
# general
r
Is this even possible to have different wheels for different platforms for a given python package fetched from two different pypi server?
h
I think that should work? Are you seeing otherwise?
r
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?
h
I think so, @enough-analyst-54434 will know for sure
e
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!
👍 1
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:
Copy code
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.
r
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.