Why does new install.python-poetry.org
script not add poetry
to PATH
?
#5917
-
The legacy
On a clean Windows 10 VM, I'm curious what the reasoning for this change was? Related to
Ubuntu (22.04) has a similar workflow: $ sudo apt install curl python3-venv
$ curl -sSL https://install.python-poetry.org | python3 -
...
Add `export PATH="/home/user/.local/bin:$PATH"` to your shell configuration file. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
The reason for this is that atomically altering the user's shell configuration files is hazardous/fraught at best, and unexpected and harmful at worst. Many users manage their shell configuration explicitly and do not appreciate any program tampering. For those that don't, it's still difficult to modify a script in an idempotent and robust manner, all to save a little bit of manual text editing that any user of a CLI program should be familiar with. Poetry additionally makes this easier by not using an unusual path, but instead using the bin directory that is part of the XDG spec ( I hesitate to say we will never adjust this behavior, but experience from other projects as well as maintaining and providing support for the old installer have led us to reject this as an anti-feature. |
Beta Was this translation helpful? Give feedback.
-
While we are on this topic: Is it not the case that prepending It allows a process with user permissions to write a file to I would suggest advising the user to append to PATH:
While this might results in poetry to be over-shadowed by some other binary, at least it does not introduce a vulnerability. Or has some thought been put into this benefit/risk trade-off and a considered decision made for this configuration advice? [edit: @neersighted ] |
Beta Was this translation helpful? Give feedback.
-
Perhaps this could be solved by adding a message at the end of the install, like:
|
Beta Was this translation helpful? Give feedback.
-
I teach Python, and found out today about this issue. This is a huge step backward. This slows down adoption. I wouldn't want to tech new an option "do you want to add poetry to ...[Y\n] would be nice In real work environment I use poetry within dev container so there is no issue there. |
Beta Was this translation helpful? Give feedback.
The reason for this is that atomically altering the user's shell configuration files is hazardous/fraught at best, and unexpected and harmful at worst. Many users manage their shell configuration explicitly and do not appreciate any program tampering. For those that don't, it's still difficult to modify a script in an idempotent and robust manner, all to save a little bit of manual text editing that any user of a CLI program should be familiar with. Poetry additionally makes this easier by not using an unusual path, but instead using the bin directory that is part of the XDG spec (
~/.local/bin
).I hesitate to say we will never adjust this behavior, but experience from other projects as we…