jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.85k stars 239 forks source link

Not so consistent use of python for poetry command (not the final version managed by poetry itself) #1077

Open jylenhof opened 8 months ago

jylenhof commented 8 months ago

If I have both python from global and local directory like this :

jylenhof@pcportablejyl:~/toto$ rtx list
jq         1.7
poetry     1.7.1   ~/.config/rtx/config.toml 1.7.1
python     3.9.18  ~/toto/.rtx.prod.toml     3.9.18
python     3.10.13
shellcheck 0.8.0
shellcheck 0.9.0   ~/toto/.tool-versions     0.9.0
shfmt      3.0.0   ~/toto/.rtx.prod.toml     3.0.0
shfmt      3.1.0
tiny       1.0.0
tiny       3.1.0
jylenhof@pcportablejyl:~/toto$ cd ..
jylenhof@pcportablejyl:~$ rtx list
jq         1.7
poetry     1.7.1   ~/.config/rtx/config.toml 1.7.1
python     3.9.18
python     3.10.13 ~/.config/rtx/config.toml 3.10
shellcheck 0.8.0
shellcheck 0.9.0
shfmt      3.0.0
shfmt      3.1.0
tiny       1.0.0
tiny       3.1.0
jylenhof@pcportablejyl:~$ 

Python used to run poetry is the one where I run the command to install poetry

If I'm not in local directory, when I do install poetry :

rtx install poetry@1.7.1

/home/jylenhof/.local/share/rtx/installs/poetry/1/venv/bin/python --version
Python 3.10.13

If I go to ~/toto

cd ~toto
rtx uninstall poetry@1.7.1
rtx install poetry@1.7.1
home/jylenhof/.local/share/rtx/installs/poetry/1/venv/bin/python --version
Python 3.9.18

So the global poetry depend on a local python or a global python version, depending from where I did the installation. For now I didn't detect an impact, but I suppose that if trying with some very different python version, it could behave differently

jdx commented 8 months ago

I'm not sure what rtx could do differently here

jdx commented 8 months ago

I believe this should not be an issue because we set this: https://python-poetry.org/docs/master/configuration/#virtualenvsprefer-active-python-experimental