Poetry: consider pipx as installation method

Created on 27 Nov 2018  ·  7Comments  ·  Source: python-poetry/poetry

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

Issue


pipx is a new project I started that replaces pipsi. pipsi is great but development and support has stopped, so I started pipx with the goal of using modern Python (venv's only, Python 3.6+), improving the UX, adding new commands, and adding an option to run applications in one-time environments that are deleted after exit.

pipx installs poetry nicely and might be a good alternate way to recommend poetry be installed.

Attached is a short video demonstrating its installation.
pipx_poetry_demo

https://github.com/cs01/pipx

Most helpful comment

@cs01 I'd gladly review and merge a PR that adds (or replace pipsi) pipx to the documentation. However it's unlikely that it will replace the recommended installer. Here are a few reasons:

  • The installer installs Poetry in such a way that it is completely isolated from the rest of the system (vendored dependencies). That way its dependencies are fixed and there is no risk of dependencies being removed or updated by the installation of another tool. I know pipx installs in a virtualenv but this is not the same thing as having a fixed set of dependencies.
  • If you install it via pipx (like with pip), Poetry will only be aware of the Python executable it has been installed for and as such will not be able to pick up the proper python version set by a tool like pyenv. Let's say I execute pipx install poetry for pipx installed for Python 3.7.1, the poetry command will be linked with Python 3.7.1. So if I later do pyenv shell 3.6, poetry will still see Python 3.7.1.

All 7 comments

This seems to be working for me. The official install method fails in Linux Mint 19 Tara

Is your proposition is to replace

curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python

by

curl https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py | python3
pipx install poetry

:question:

IMO it makes sense to let poetry stop worrying about maintaining custom installers and let pipx focus on that. So long term I think replacing is the right choice.

This means

poetry self:update

will turn into

pipx upgrade poetry

and to install a specific version,

pipx upgrade poetry --spec poetry==0.12.5

The poetry self:update --preview option would need to be replaced with something like

pipx upgrade poetry --spec git+https://github.com/sdispater/poetry.git@develop

The preview option will only work once pip has support for PEP 517 added (it currently fails with this command because it is hardcoded to install by cloning the git repo, then running setup.py rather than being flexible enough to be told to clone and run poetry install).

Unless @sdispater or others feel it is generally more reliable than the recommended installation method (as @gonvaled indicated), I am currently suggesting that it is added alongside the pipsi instructions.

@cs01 I'd gladly review and merge a PR that adds (or replace pipsi) pipx to the documentation. However it's unlikely that it will replace the recommended installer. Here are a few reasons:

  • The installer installs Poetry in such a way that it is completely isolated from the rest of the system (vendored dependencies). That way its dependencies are fixed and there is no risk of dependencies being removed or updated by the installation of another tool. I know pipx installs in a virtualenv but this is not the same thing as having a fixed set of dependencies.
  • If you install it via pipx (like with pip), Poetry will only be aware of the Python executable it has been installed for and as such will not be able to pick up the proper python version set by a tool like pyenv. Let's say I execute pipx install poetry for pipx installed for Python 3.7.1, the poetry command will be linked with Python 3.7.1. So if I later do pyenv shell 3.6, poetry will still see Python 3.7.1.

Note that poetry is incompatible with docker-compose. They conflict on jsonschema version. That's a good reason to have poetry in it's own venv. I just wished .poetry was in .local or .cache because i don't like to clutter my home.

Now I really have the feeling that a Python packaging/dependency manager shouldn’t be written in Python… :disappointed:

Note that poetry is incompatible with docker-compose. They conflict on jsonschema version. That's a good reason to have poetry in it's own venv. I just wished .poetry was in .local or .cache because i don't like to clutter my home.

well, you'd have to install Docker-Compose w/ pipx.

Was this page helpful?
0 / 5 - 0 ratings