install-poetry.py
doesn't exit with proper status code when installation fails
#4424
Closed
1 of 3 tasks
Labels
kind/bug
Something isn't working as expected
I am on the latest Poetry version.Not applicable, as it's on the installerI have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (Not applicable, as it's on the installer-vvv
option).OS version and name: ArchLinux and Debian 11
Issue
install-poetry.py
doesn't exit with the proper exit code if the installation of Poetry usingpip
failed.This is due to
subprocess.run
command ininstall_poetry
not usingcheck=True
to make sure that an exception is raised if the output returned with an exit code other than 0:poetry/install-poetry.py
Lines 584 to 588 in c967a4a
See documentation for
subprocess.run
https://docs.python.org/3/library/subprocess.html#subprocess.runReproducibility
To showcase the issue (and also show what the expected behaviour should be with a fix), I've created a dedicated repository with 2 Dockerfile that GitHub Actions ran on: https://github.com/mkniewallner/showcase-poetry-installer-issue
In the workflow, two jobs have been defined:
poetry-master
: Tries to install poetry using Python 3.10.0rc1 viainstall-poetry.py
frompython-poetry/poetry
repositorypoetry-with-fix
: Tries to install poetry using Python 3.10.0rc1 viainstall-poetry.py
frommkniewallner/poetry
repository on a commit containg a potential fixOn both jobs, it wasn't possible to install Poetry because of missing system dependencies for
cffi
module, but:poetry-master
, the step that tries to install Poetry doesn't return with a non-zero exit code, as it runpoetry --version
just after (see logs)poetry-with-fix
, the step that tries to install Poetry correctly returns with a non-zero exit code, displays the error that happened, and doesn't runpoetry --version
just after, as the installation failed so it ends the workflow early (see logs)The text was updated successfully, but these errors were encountered: