Skip to content

Commit

Permalink
Improve system detection for brew python
Browse files Browse the repository at this point in the history
  • Loading branch information
singiamtel committed Nov 5, 2024
1 parent 08ef371 commit 5c1b052
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ env:
PYTHONPATH: "$PYTHON_ROOT/lib/python/site-packages"
prefer_system: "(?!slc5|ubuntu)"
prefer_system_check: |
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python{version_info.major}.{version_info.minor}")'
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
case $ALIBUILD_ARCHITECTURE in

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]
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 23 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

line too long (145 > 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 25 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

line too long (137 > 120 characters) [yl:line-length]
;;
esac
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 28 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 28 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Quote this to prevent word splitting. [SC2046]

Check notice on line 28 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:
"python3.9":
version: "3.9"
"python3.10":
version: "3.10"
"python3.11":
version: "3.11"
"python3.12":
version: "3.12"
"python3.13":
version: "3.13"
"python-brew3.*":
env:

Check notice on line 31 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 32 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 35 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 36 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 5c1b052

Please sign in to comment.