pypa / pipx

Install and Run Python Applications in Isolated Environments
https://pipx.pypa.io
MIT License
9.51k stars 396 forks source link

Use multiple machine suffixes for standalone python #1462

Closed tusharsadhwani closed 1 week ago

tusharsadhwani commented 1 week ago

Summary of changes

With the release of Yen v0.5, pipx and yen are officially rivals (; But since it's very easy to port my bug fixes to pipx, I decided to do just that.

For now, this change only adds 1 new suffix compared to the previous logic: x86_64-unknown-linux-gnu, as a user reported this problem: https://github.com/tusharsadhwani/yen/issues/17

python-build-standalone ships various tiers of unkown-linux-gnu python builds. from v1 to v4. v4 is highly CPU specific and requires modern CPU features, only available on higher end desktop chips starting from early 2010s.

I defaulted to v3 for a compromise of good speed, and good compatibility with most machines. But in the more recent releases, v3 no longer ships python3.8 wheels. Having a fallback to the v1 machine suffix would fix this problem.

Test plan

pipx run --python=python3.8 --fetch-missing-python meowsay hi

On a Linux machine, this would fail on main branch (as 3.8 is not available in for x86_64-v3-unknown-linux-gnu.

But with the current change it will work, as it is available in x86_64-unknown-linux-gnu variant.

chrysle commented 1 week ago

Thanks! Healthy competition stimulates the business; we mustn't leave the field to uv. Don't expect us to port our bug fixes though ;-) (I don't know Rust, anyway).