dyuri / xontrib-langenv

pyenv integration for xonsh
MIT License
12 stars 3 forks source link

Maybe convert xsh to py for faster startup? #13

Closed eugenesvk closed 1 year ago

eugenesvk commented 1 year ago

Since xonsh xontribs are not compiled unlike the .py ones, so take slower to start https://github.com/xonsh/xonsh/issues/3953, it might make sense to rewrite this xontrib in Python?

I've taken a stab at it by changing the pyenv version (and the langenv_common) in this fork https://github.com/eugenesvk/xontrib-langenv/tree/repy, besides conversion I've also didn't understand why there is a need to search for tools themselves (not their shims) that are supposed to be in PATH already if they're properly installed, so just replaced it ;) with a lazy search of known xonsh binaries

upd: seems to be working, also https://github.com/dyuri/xontrib-langenv/issues/14 is fixed However, I don't get how source-bash works, it doesn't print anything even in the regular subprocess, e.g. source-bash --suppress-skip-message -n "echo 1" doesn't print 1, so in the create_alias function when you do pyenv shell which ultimately goes to source-bash to source echo $PYTHON_VERSION, nothing is printed even if said variable exists

asked this question in xonsh discussions https://github.com/xonsh/xonsh/discussions/5019