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

Rebuild python dependencies whenever needed #5660

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion python-modules.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package: Python-modules
version: "1.0"
requires:
- "Python:(slc|ubuntu)"
- "Python"
- "Python-system:(?!slc.*|ubuntu)"
- "FreeType:(?!osx)"
- libpng
Expand Down
44 changes: 42 additions & 2 deletions python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,48 @@
PYTHONHOME: "$PYTHON_ROOT"
PYTHONPATH: "$PYTHON_ROOT/lib/python/site-packages"
prefer_system: "(?!slc5|ubuntu)"
prefer_system_check:
python3 -c 'import sys; import sqlite3; sys.exit(1 if sys.version_info < (3, 9) 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
prefer_system_check: |
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.*":
env:

Check notice on line 45 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 46 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 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
Loading