Issue
It's common knowledge at this point that using the recommended installer of Poetry can lead to a lot of problems, being permissions issues, different behaviors depending on how Python was installed.
So, before we reach version 1.0 we have to tackle this problem in order to make installing Poetry as painless as possible.
Every proposition made at this point (using pipsi, using sudo) are not satisfying enough to make an intuitive experience.
We should keep using a custom installer, in my opinion, and make it more clever.
For that, I think taking an inspiration in what rustup/Cargo does would be ideal. Basically we would have the following steps:
- Download the latest stable (or pre-release) version of poetry.
- Download all its dependencies in the
poetry/_vendor directory.
- Copy it and all extra files in
$POETRY_HOME (~/.poetry/ for UNIX systems and %USERPROFILE%/.poetry/ on Windows).
- Updates the PATH automatically in a system-specific way.
The $POETRY_HOME directory would contain two directories:
lib which would contain the complete poetry package.
bin which would contain a poetry script that could be called from any currently activated Python executable. This directory would be added to the PATH automatically.
This has many advantages:
- Installing in the user directory makes sure that we have write access.
- One single installation of Poetry necessary that can be used by any Python executable.
- Easier for the
self:update command to work thanks to a single possible location.
- The automatic update of the PATH removes the hassle for the end user to do it themselves.
The poetry script in bin/ could look like this on UNIX systems:
#!/usr/bin/env python
import sys
import os
lib = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "lib"))
sys.path.insert(0, lib)
if __name__ == "__main__":
from poetry.console import main
main()
Issue
It's common knowledge at this point that using the recommended installer of Poetry can lead to a lot of problems, being permissions issues, different behaviors depending on how Python was installed.
So, before we reach version
1.0we have to tackle this problem in order to make installing Poetry as painless as possible.Every proposition made at this point (using
pipsi, usingsudo) are not satisfying enough to make an intuitive experience.We should keep using a custom installer, in my opinion, and make it more clever.
For that, I think taking an inspiration in what
rustup/Cargodoes would be ideal. Basically we would have the following steps:poetry/_vendordirectory.$POETRY_HOME(~/.poetry/for UNIX systems and%USERPROFILE%/.poetry/on Windows).The
$POETRY_HOMEdirectory would contain two directories:libwhich would contain the completepoetrypackage.binwhich would contain apoetryscript that could be called from any currently activated Python executable. This directory would be added to the PATH automatically.This has many advantages:
self:updatecommand to work thanks to a single possible location.The
poetryscript inbin/could look like this on UNIX systems: