Open SergiyKolesnikov opened 1 year ago
"system" (in both pyenv and rtx) imply a no-op. This means it will just use whatever binaries is on PATH. However in the case of python if you have multiple versions installed I have no way to know that something like python3.9
shouldn't be used from a different version. I'm not actually sure how pyenv gets around this issue.
I don't know how this could be solved short of hardcoding binary names which I don't think is something I would want to do.
I'm unclear on how it's expected to work with multiple versions in Python -- I came to this issue now because I need all installed versions available by name, but they're not.
(zsh)
$ grep python ~/.config/mise/config.toml
python = "latest"
$ cat .tool-versions
python 3.13 3.12 3.11 3.10 3.9 3.8 3.7
$ mise install
mise all runtimes are installed
$ ls ~/.local/share/mise/installs/python
3
3.10
3.10.14
3.10.15
3.11
3.11.10
3.11.8
3.12
3.12.2
3.12.7
3.13-dev
3.7
3.7.17
3.7.9
3.8
3.8.19
3.8.20
3.9
3.9.19
3.9.20
latest
$ print -rl -- $path | grep mise
/home/andy/.local/share/mise/installs/python/3.11.10/bin
/home/andy/.local/share/mise/installs/hyperfine/latest/bin
/home/andy/.local/share/mise/installs/usage/latest/bin
/home/andy/.local/share/mise/installs/shellcheck/latest/bin
/home/andy/.local/share/mise/installs/lua/latest/bin
/home/andy/.local/share/mise/installs/lua/latest/luarocks/bin
/home/andy/.local/share/mise/installs/just/latest/bin
What about mise ls
?
Well today all the relevant paths are present, and it works as I'd hope:
$ print -rl -- $path | grep 'mise.*python'
/home/andy/.local/share/mise/installs/python/3.12/bin
/home/andy/.local/share/mise/installs/python/3.11/bin
/home/andy/.local/share/mise/installs/python/3.10/bin
/home/andy/.local/share/mise/installs/python/3.9/bin
/home/andy/.local/share/mise/installs/python/3.8/bin
/home/andy/.local/share/mise/installs/python/3.7/bin
So as long as that's what you expect, and this is how it continues to act, I'm just adding noise here -- sorry!
rtx behaves differently from asdf and pyenv if Python's system version is configured along with additionally installed versions. (Similar issue #831)
Pyenv allows to use all versions:
asdf only allows the system version:
rtx allows all but the system version (unless called explicitly through the versioned binary):
For all these behaviors, the behavior of pyenv is the one of least surprise. It is also useful, because it allows to preserver the system Python version as default for programs that rely on it (for example, those installed with the system package manager) and at the same time allow "smart" tools that can use versioned Python binaries do their magic. For example, poetry knows which version of Python is needed for a given project and can look for the corresponding versioned Python binary, so there is no need in .tool-versions.