Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry install ignore build script failure #6182

Closed
3 tasks done
touilleMan opened this issue Aug 17, 2022 · 3 comments
Closed
3 tasks done

poetry install ignore build script failure #6182

touilleMan opened this issue Aug 17, 2022 · 3 comments
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues

Comments

@touilleMan
Copy link

  • I am on the latest Poetry version.

  • I 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 (-vvv option).

  • OS version and name: all

  • Poetry version: 1.2.0b3

Issue

When using a build script in the pyproject.toml (i.e. the script = "build.py" in [tool.poetry.build]), the return status from the build script is ignored by the poetry install command:

$ poetry install -E backend -E core
Installing dependencies from lock file

No dependencies to install or update

Preparing build environment with build-system requirements poetry-core>=1.0.0, setuptools, maturin~=0.13, PyQt5~=5.15, Babel~=2.10, docutils~=0.17
PYTHON_EXECUTABLE_PATH=/tmp/tmp44hka6ee/.venv/bin/python
Launching poetry build.py script
Traceback (most recent call last):
  File "/mnt/c/Users/gbleu/source/repos/parsec-cloud/parsec-cloud/build.py", line 74, in <module>
    build()
  File "/mnt/c/Users/gbleu/source/repos/parsec-cloud/parsec-cloud/build.py", line 39, in build
    raise SystemError("D'oh !")
SystemError: D'oh !
Installing the current project: parsec-cloud (v2.11.1+dev)
$ echo $?
0

The expected behavior would be to have the poetry install command stopped and return an error status, this is for instance the behavior of poetry build --wheel

$ poetry build --format wheel
Preparing build environment with build-system requirements poetry-core>=1.0.0, setuptools, maturin~=0.13, PyQt5~=5.15, Babel~=2.10, docutils~=0.17
Building parsec-cloud (v2.11.1+dev)
PYTHON_EXECUTABLE_PATH=/tmp/tmp5ef_ve_y/.venv/bin/python
Launching poetry build.py script
Traceback (most recent call last):
  File "/mnt/c/Users/gbleu/source/repos/parsec-cloud/parsec-cloud/build.py", line 74, in <module>
    build()
  File "/mnt/c/Users/gbleu/source/repos/parsec-cloud/parsec-cloud/build.py", line 39, in build
    raise SystemError("D'oh !")
SystemError: D'oh !

Command '['/tmp/tmp5ef_ve_y/.venv/bin/python', 'build.py']' returned non-zero exit status 1.
$ echo $?
1

The issue comes from env.run being called with call=True (with this option the subprocess return status is not checked)

env.run("python", str(self._path.joinpath(build_script)), call=True)

@touilleMan touilleMan added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 17, 2022
@qualiaa
Copy link

qualiaa commented Mar 16, 2023

I've also bumped into this issue. It would be great if poetry install reported errors from the build in the same way as poetry build and pip install.

@dimbleby
Copy link
Contributor

duplicate #3717, please close

@radoering radoering added status/duplicate Duplicate issues and removed status/triage This issue needs to be triaged labels Apr 22, 2023
@radoering radoering closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants