Skip to content

Commit

Permalink
Add workaround for old alibuild versions (< v1.17.12)
Browse files Browse the repository at this point in the history
  • Loading branch information
singiamtel committed Nov 13, 2024
1 parent dd98d84 commit f82c060
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,27 @@ env:
PYTHONPATH: "$PYTHON_ROOT/lib/python/site-packages"
prefer_system: "(?!slc5|ubuntu)"
prefer_system_check: |
case $ALIBUILD_ARCHITECTURE in
osx*)
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python-brew{version_info.major}.{version_info.minor}")' ;;
*)
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python{version_info.major}.{version_info.minor}")'
;;
esac
MIN_ALIBUILD_VERSION_REGEX="v1.17.12"

Check notice on line 21 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Missing script shebang. Use exactly "#!/bin/bash -e" to match aliBuild environment. You may see spurious errors until you fix the shebang. [ali:bad-shebang]
if [[ $(printf '%s\n' "$ALIBUILD_VERSION" "$MIN_ALIBUILD_VERSION_REGEX" | sort -V | head -n 1) == "$ALIBUILD_VERSION" && "$ALIBUILD_VERSION" != "$MIN_ALIBUILD_VERSION_REGEX" ]]; then

Check warning on line 22 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

line too long (186 > 120 characters) [yl:line-length]
# Workaround to support old alibuild versions that don't regex match alibuild_system_replace
case $ALIBUILD_ARCHITECTURE in
osx*)
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python-brew3")' ;;
*)
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python3")'
;;
esac
else
case $ALIBUILD_ARCHITECTURE in
osx*)
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python-brew{version_info.major}.{version_info.minor}")' ;;

Check warning on line 34 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

line too long (149 > 120 characters) [yl:line-length]
*)
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python{version_info.major}.{version_info.minor}")'

Check warning on line 36 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

line too long (141 > 120 characters) [yl:line-length]
;;
esac
fi
python3 -c 'import sys; import sqlite3; sys.exit(1 if sys.version_info < (3, 9) or sys.version_info > (3, 13) else 0)' && python3 -m pip --help > /dev/null && printf '#include "pyconfig.h"' | cc -c $(python3-config --includes) -xc -o /dev/null -; if [ $? -ne 0 ]; then printf "Python, the Python development packages, and pip must be installed on your system.\nUsually those packages are called python, python-devel (or python-dev) and python-pip.\n"; exit 1; fi

Check warning on line 42 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

line too long (466 > 120 characters) [yl:line-length]

Check warning on line 42 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Quote this to prevent word splitting. [SC2046]

Check notice on line 42 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. [SC2181]
prefer_system_replacement_specs:
"python-brew3.*":
Expand All @@ -35,6 +49,16 @@ prefer_system_replacement_specs:
env:

Check notice on line 49 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

prefer_system_replacement_specs.python3.*.recipe should create a Modulefile; use alibuild-generate-module or add a "#%Module1.0" comment to your manually-created Modulefile [ali:missing-modulefile]
PYTHON_ROOT: ""

Check warning on line 50 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

wrong indentation: expected 6 but found 8 [yl:indentation]
PYTHON_REVISION: ""
# Workaround to support old alibuild versions that don't regex match alibuild_system_replace
"python-brew3":
env:

Check notice on line 55 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

prefer_system_replacement_specs.python-brew3.recipe should create a Modulefile; use alibuild-generate-module or add a "#%Module1.0" comment to your manually-created Modulefile [ali:missing-modulefile]
PYTHON_ROOT: $(brew --prefix python3)

Check warning on line 56 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

wrong indentation: expected 6 but found 8 [yl:indentation]
PYTHON_REVISION: ""
"python3":
env:

Check notice on line 59 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

prefer_system_replacement_specs.python3.recipe should create a Modulefile; use alibuild-generate-module or add a "#%Module1.0" comment to your manually-created Modulefile [ali:missing-modulefile]
PYTHON_ROOT: ""

Check warning on line 60 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

wrong indentation: expected 6 but found 8 [yl:indentation]
PYTHON_REVISION: ""
---
rsync -av --exclude '**/.git' $SOURCEDIR/ $BUILDDIR/
Expand Down

0 comments on commit f82c060

Please sign in to comment.