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

make build does not fail when a requirement fails to install #1120

Open
MattiSG opened this issue Apr 25, 2022 · 0 comments
Open

make build does not fail when a requirement fails to install #1120

MattiSG opened this issue Apr 25, 2022 · 0 comments

Comments

@MattiSG
Copy link
Member

MattiSG commented Apr 25, 2022

Hi there!

I really enjoy OpenFisca, but I recently encountered an issue.

Here is what I did:

make build with a setup.py that expressed an unmatchable constraint (e.g. bumping major of openfisca-core, creating an incompatibility with openfisca-country-template that prevents this latter package from being installed).

Here is what I expected to happen:

make build fails.

Here is what actually happened:

The failure is logged, but make build succeeds, leading to all other tests failing for very strange reasons. For example, make test-core fails with a /opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/subprocess.py:1551: FileNotFoundError

Here is data (or links to it) that can help you reproduce this issue:

This CI run illustrates the problem: https://github.com/openfisca/openfisca-core/runs/6157548243

Source of the problem

make build uses find -exec. This does not aggregate exit codes.

Solutions

The following solutions were tried:

  • find dist -name "*.whl" -exec sh -c "for wheel; do pip install ${wheel}[dev]; done" sh {} \+ # use sh and "+" instead of closing ";" in order to propagate exit code to find in case of install failures; see https://unix.stackexchange.com/a/392973
  • find dist -name "*.whl"; pip install $(!!)
  • for wheel in "dist/*.whl"; do echo $wheel [dev] | tr -d " "; done
  • pip install $$(find dist -name "*.whl")[dev]

The last one works (👏 @sandcha), but supports having only one wheel file. This seems to be the case every time, but context for the initial implementation would be welcome.

Context

I identify more as a:

  • Developer (I create tools that use the existing OpenFisca code).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant