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 lib/poetry-lock/poetry-lock-all.sh failures more obvious #1107

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/poetry-lock/poetry-lock-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

root="$(pwd)"
fail() {
echo FAILED
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd do this: echo "FAILED: $@"
To make it a little harder to miss.

or if you think people will be bad at reading:

echo FAILED FAILED FAILED FAILED
echo "$@"
echo FAILED FAILED FAILED FAILED

echo "$@"
exit 1
}
Expand All @@ -25,19 +26,19 @@ for i in ${tomls}; do
(
echo "--------------------- special casing in $i"
cd $(dirname "$i")
poetry lock --no-update || exit 1
poetry lock --no-update || fail "broke on special case 'poetry lock --no-update' for $i"
# Do not apply the consistency logic, it can't do anything useful.
) || exit 1
) || fail "broke on special case for $i"
continue
fi
(
echo "--------------------- processing in $i"
cd $(dirname "$i")
poetry lock --no-update || exit 1
poetry install 2>&1 | tee /tmp/poetry-install.out || exit 1
poetry lock --no-update || fail "broke on regular case 'poetry lock --no-update' $i"
poetry install 2>&1 | tee /tmp/poetry-install.out || fail "broke on 'poetry install' for $i"
perl -ne 'print qq{$1 = "$2"\n} if /Downgrading (\S+) \((\S+) ->/o;' </tmp/poetry-install.out >/tmp/downgraded
cat /tmp/downgraded
[[ $(wc -l </tmp/downgraded) -eq 0 ]] || exit 1
) || exit 1
[[ $(wc -l </tmp/downgraded) -eq 0 ]] || fail "broke on downgrading $i it seems these packages are incompatible"
) || fail "broke on regular case $i"
done
echo "SUCCESS"
Loading