tusharsadhwani / yen

The last Python environment manager you'll ever need.
MIT License
210 stars 9 forks source link

Add `install`, `run` and `ensurepath` commands #21

Closed tusharsadhwani closed 3 months ago

tusharsadhwani commented 3 months ago

Implements all the functionality of pipx.

Some interesting hacks needed to be done to implement all this in Rust, to keep the user PATH editing code consistent between the Python and rust implementation I chose the userpath Python package for adding the packages to PATH.

To be able to call userpath from both Python and Rust, I forked, avoided the click dependency, and packaged the source into a zipapp. The zipapp is hosted alongside the install scripts, and is downloaded in the install script as well. In case the install script was never ran, the library itself can download those binaries as soon as they're needed, but that's kept as a fallback to avoid unnecessary dependency on an internet connection for everyday use.