make build does not fail when a requirement fails to install
MattiSG opened this issue · comments
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
findin 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).