Poetry: Add poetry to all shells on install?

Created on 14 Oct 2020  ·  7Comments  ·  Source: python-poetry/poetry

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the documentation and believe that my question is not covered.

Feature Request

Currently it seems that poetry adds itself to the PATH in the system's default shell. Here's an example — this system has fish as a default shell, and when installing on bash, only the path on fish is modified:

bash-5.0$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

$HOME/.poetry/bin

This path will then be added to your `PATH` environment variable by
modifying the `fish_user_paths` universal variable.

Note the modifying the 'fish_user_paths'.

This means that it then won't be linked in bash. This is particularly an issue on Mac where zsh is now the default shell, but many people still use bash.

Is there a reason to not link in all available shells?
Or at least the current shell and the default shell?

Thanks as ever for the excellent tool!

Feature Question Triage

All 7 comments

Well, I'll propose a PR and I guess we can continue the discussion from there.

This is particularly an issue on Mac where zsh is now the default shell, but many people still use bash.

But, to be clear, this should not be an issue. Windows and fish are the only special cases. The rest are Unix shells, and all profile files found will be modified.

I'll just change it so that those files are also modified when Poetry is installed under fish.

I am curious if it is better for us to link or add poetry bin into user's available path if possible than modifying profile files.

I think I suggested ages ago that we linked it from ~/.local/bin and just hope for the best, hahah.

I don't think that looking at the PATH to decide where to put it is a good idea, but maybe make it add ~/.local/bin to PATH instead of the Poetry directory, via the method currently implemented, and then link from there.

Is there a comparable solution for Windows?

Is there a comparable solution for Windows?

Hum... I can only think of the Python scripts' directory, which is often added to the PATH. But I'm not even sure of how links work on Windows.

This is particularly an issue on Mac where zsh is now the default shell, but many people still use bash.

But, to be clear, this should not be an issue. Windows and fish are the only special cases. The rest are Unix shells, and all profile files found will be modified.

That makes sense — my mistake

Thanks a lot for the PR!

Was this page helpful?
0 / 5 - 0 ratings