Skip to content

Commit

Permalink
python_metapackages.yml: update logic for installed_default
Browse files Browse the repository at this point in the history
Modify the logic to only take the first occurence of the Identified best
package. This is because setup.py prints out the package multiple times
like so:

  [cudaq] Identified cuda-quantum-cu12 as the best package.
  [cudaq] Identified cuda-quantum-cu12 as the best package.
  [cudaq] Identified cuda-quantum-cu12 as the best package.

Which will make installed_default="cuda-quantum-cu12
cuda-quantum-cu12
cuda-quantum-cu12"

which fails the logic test for the CI. This Identified package should be
the same for all prints, so the first occurence is taken.

Signed-off-by: mitchdz <[email protected]>
  • Loading branch information
mitchdz committed Nov 22, 2024
1 parent d534dcf commit e03b891
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/python_metapackages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ jobs:
if [ -f /tmp/install.out ] && [ -z "$(cat /tmp/install.out | grep -o 'Autodetection succeeded')" ]; then
# Autodetection failed - a default choice of the binary distribution will be installed.
echo "::warning::Autodetection to determine cudaq binary distribution failed."
installed_default=$(cat /tmp/install.out | sed -nE 's/.*Identified (\S*) as the best package.*/\1/p')
# Take the first Identified best package because the logs print multiple lines.
# They should all be the same, if they differ in the build environment then there is probably issues.
installed_default=$(cat /tmp/install.out | sed -nE 's/.*Identified (\S*) as the best package.*/\1/p' | head -n 1)
echo "::warning::The installed default is ${installed_default}, the potential conflicting package is ${test_conflicting}"
if [ "$installed_default" == "$test_conflicting" ]; then
check_package=none
Expand Down

0 comments on commit e03b891

Please sign in to comment.