[BUG] dephell symlink should be created in a certain directory
Short description
When installing dephell and having such defined PATH in .zshrc / .bashrc:
export PATH="$HOME/.poetry/bin:$PATH"
a symlink for dephell would be created in $HOME/.poetry/bin directory (due to bin_dir() function implementation).
Expected behaviour
In general, that part:
paths = [Path(path) for path in environ.get('PATH', '').split(pathsep)]
for path in paths:
if path.exists() and '.local' in path.parts:
return path
for path in paths:
if path.exists():
return path
is very risky, because you don't know what you can find in PATH.
Instead of that, you should define some default location like ~/.local/bin or /usr/local/bin and make sure it exists (== create if missing, e.g. I had ~/.local, but without bin subdirectory, so path = Path.home() / '.local' / 'bin' failed). Any other path can be an optional installation parameter to change if needed.
As a quick workaround for now - you can add additional installation step, e.g.:
mkdir -p ~/.local/bin
before the proper command.
Steps to reproduce
- Install poetry
- Modify
PATHas above -
curl -L dephell.org/install | python3
Versions
"version": "0.8.1"