Skip to content
Merged
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Until May 2022 (inclusive) no changelog was kept. We might try to reconstruct it
* GSL: Update to 2.8 for ROOT compatibility
* libpng: update to 1.6.47
* FairRoot: Update to 19.0.0
* Python: Update to 3.12.12, unpin most python packages, add distro package to
fix aliBuild architecture detection

### Removed

Expand Down
153 changes: 28 additions & 125 deletions python-modules-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,132 +2,35 @@ package: Python-modules-list
version: "1.0"
env:
PIP_BASE_REQUIREMENTS: |
pip==25.0.1
setuptools==59.6.0
wheel==0.37.1
pip>=25.3
setuptools>=80.10.1
wheel>=0.45.1
distro>=1.9.0
PIP_REQUIREMENTS: |
requests==2.27.1
ipykernel==5.1.0
ipython==7.4.0
ipywidgets==7.4.2
metakernel==0.20.14
mock==2.0.0
notebook==5.7.8
scons==4.1.0
PIP36_REQUIREMENTS: |
PyYAML==6.0.1
psutil==5.8.0
uproot==4.1.0
numpy==1.16.2
scipy==1.2.1
Cython==0.29.16
seaborn==0.9.0
sklearn-evaluation==0.4
Keras==2.2.4
tensorflow==1.13.1
xgboost==0.82
dryable==1.0.3
responses==0.10.6
pandas==0.24.2
scikit-learn==0.20.3
PIP38_REQUIREMENTS: |
PyYAML==6.0.1
psutil==5.8.0
uproot==4.1.0
scipy==1.6.1
Cython==0.29.21
seaborn==0.9.0
sklearn-evaluation==0.4
Keras==2.4.3
tensorflow==2.4.1
xgboost==1.3.3
numpy==1.19.5
dryable==1.0.3
responses==0.10.6
pandas==1.2.3
scikit-learn==0.24.1
PIP39_REQUIREMENTS: |
PyYAML==6.0.1
psutil==5.8.0
uproot==4.1.0
numpy==1.21.6
scipy==1.7.3
Cython==0.29.21
seaborn==0.11.0
scikit-learn==0.24.1
sklearn-evaluation==0.5.2
Keras==2.4.3
xgboost==1.2.0
dryable==1.0.5
responses==0.10.6
pandas==1.1.5
future
"PIP39_REQUIREMENTS_ubuntu2110_x86_64": |
PyYAML==6.0.1
psutil==5.8.0
uproot==4.1.0
numpy==1.21.4
scipy==1.7.3
Cython==0.29.21
seaborn==0.11.0
scikit-learn==0.24.1
sklearn-evaluation==0.5.2
Keras==2.4.3
xgboost==1.2.0
dryable==1.0.5
responses==0.10.6
pandas==1.1.5
# Keep the PIPxy version in sync with the Conda env we install in Python-modules!
# Everything but the first two lines copied from PIP39_REQUIREMENTS, but with versions
# adjusted such that wheels are available and for compatibility with tensorflow.
PIP39_REQUIREMENTS_osx_arm64: |
tensorflow-macos==2.13.0
tensorflow-metal==1.0.1
PyYAML==6.0.1
psutil==5.9.5
uproot==4.1.0
numpy==1.23.5
scipy==1.10.1
Cython==0.29.21
seaborn==0.11.0
scikit-learn==1.2.2
sklearn-evaluation==0.12.0
Keras==2.13.1
xgboost==1.7.5
dryable==1.0.5
responses==0.10.6
pandas==1.5.3
PIP310_REQUIREMENTS: |
PyYAML==6.0.1
psutil==5.9.0
uproot==4.1.0
numpy==1.23.5
scipy==1.9.3
Cython==0.29.21
seaborn==0.11.0
scikit-learn>=0.24.1
sklearn-evaluation>=0.8.1
Keras==2.4.3
xgboost==1.2.0
dryable==1.0.5
responses==0.10.6
pandas==1.5.3
PIP311_REQUIREMENTS: |
PyYAML==6.0.1
psutil==5.9.5
uproot==4.1.0
numpy==1.23.5
scipy==1.10.1
Cython==0.29.21
seaborn==0.11.0
scikit-learn==1.3.0
sklearn-evaluation==0.12.0
Keras==2.13.1
xgboost==1.7.5
dryable==1.0.5
responses==0.10.6
pandas==1.5.3
pybind11==2.13.6
requests>=2.32.5
ipykernel>=7.1.0
ipython>=9.9.0
ipywidgets>=8.1.8
metakernel>=0.30.4
mock>=5.2.0
notebook>=7.5.2
scons>=4.10.1
PIP312_REQUIREMENTS: |
PyYAML>=6.0.3
psutil>=7.2.1
uproot>=5.6.9
numpy>=2.4.1
scipy>=1.17.0
Cython>=3.2.4
seaborn>=0.13.2
scikit-learn>=1.8.0
sklearn-evaluation>=0.12.2
Keras>=3.13.1
xgboost>=3.1.3
dryable>=1.2.0
responses>=0.25.8
pandas>=3.0.0
pybind11>=3.0.1
build_requires:
- alibuild-recipe-tools
---
Expand Down
2 changes: 1 addition & 1 deletion python-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ case $ARCHITECTURE in
esac

# Major.minor version of Python
pyver="$(python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_version())')"
pyver="$(python3 -c 'import sysconfig; print(sysconfig.get_python_version())')"

# These are the basic requirements needed for all installation and platform
# and it should represent the common denominator (working) for all packages/platforms
Expand Down
53 changes: 30 additions & 23 deletions python.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package: Python
version: "%(tag_basename)s"
tag: v3.9.16
tag: v3.12.12
source: https://github.com/python/cpython
requires:
- FreeType
Expand All @@ -16,13 +16,34 @@
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, 5) 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: |
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python{version_info.major}.{version_info.minor}")'

Check warning on line 20 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

line too long (129 > 120 characters) [yl:line-length]
python3 -c 'import sys; import sqlite3; sys.exit(1 if sys.version_info < (3, 9) or sys.version_info > (3, 15) 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 notice on line 21 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]

Check warning on line 21 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Quote this to prevent word splitting. [SC2046]

Check warning on line 21 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

line too long (466 > 120 characters) [yl:line-length]
prefer_system_replacement_specs:
"python-brew3.*":
version: "%(key)s"

Check notice on line 24 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]
env:
PYTHON_ROOT: $(brew --prefix python3)

Check warning on line 26 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

wrong indentation: expected 6 but found 8 [yl:indentation]
PYTHON_REVISION: ""
"python3.*":
version: "%(key)s"

Check notice on line 29 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]
env:
# Python is in path, so we need a dummy placeholder for PYTHON_ROOT
# to avoid having /bin in the middle of the path.
PYTHON_ROOT: "/dummy-python-folder"

Check warning on line 33 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/

# According to cmsdist, this is required to pick up our own version
export LIBFFI_ROOT
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:${PKG_CONFIG_PATH}

# If the python installer finds another pip, it won't install the new one
export PATH=$(echo $PATH | awk -v RS=':' -v ORS=':' '!/python/ {print}' | sed 's/:$//')

Check warning on line 43 in python.sh

View workflow job for this annotation

GitHub Actions / alidistlint

Declare and assign separately to avoid masking return values. [SC2155]
unset PYTHONUSERBASE
unset PYTHONHOME
unset PYTHONPATH

# The only way to pass externals to Python
LDFLAGS=
Expand All @@ -34,27 +55,7 @@
export LDFLAGS=$(echo $LDFLAGS)
export CPPFLAGS=$(echo $CPPFLAGS)

case $ARCHITECTURE in
osx*) [[ ! $OPENSSL_ROOT ]] && OPENSSL_ROOT=$(brew --prefix openssl@3) ;;
esac

# Set own OpenSSL if appropriate
if [[ $OPENSSL_ROOT ]]; then
export CPATH="$OPENSSL_ROOT/include:$OPENSSL_ROOT/include/openssl:$CPATH"
export CPPFLAGS="-I$OPENSSL_ROOT/include -I$OPENSSL_ROOT/include/openssl $CPPFLAGS"
export CFLAGS="-I$OPENSSL_ROOT/include -I$OPENSSL_ROOT/include/openssl"
cat >> Modules/Setup.dist <<EOF

SSL=$OPENSSL_ROOT
_ssl _ssl.c \
-DUSE_SSL -I\$(SSL)/include -I\$(SSL)/include/openssl \
-L\$(SSL)/lib -lssl -lcrypto
EOF

fi

./configure --prefix="$INSTALLROOT" \
${OPENSSL_ROOT:+--with-openssl=$OPENSSL_ROOT} ${OPENSSL_ROOT:+--with-openssl-rpath=no} \
--enable-shared \
--with-system-expat \
--with-ensurepip=install
Expand All @@ -68,6 +69,7 @@
PYTHON_BIN=$(for X in python*; do echo "$X"; done | grep -E '^python[0-9]+\.[0-9]+$' | head -n1)
PIP_BIN=$(for X in pip*; do echo "$X"; done | grep -E '^pip[0-9]+\.[0-9]+$' | head -n1)
PYTHON_CONFIG_BIN=$(for X in python*-config; do echo "$X"; done | grep -E '^python[0-9]+\.[0-9]+m?-config$' | head -n1)
chmod +x $PYTHON_BIN $PIP_BIN $PYTHON_CONFIG_BIN
[[ -x python ]] || ln -nfs "$PYTHON_BIN" python
[[ -x python3 ]] || ln -nfs "$PYTHON_BIN" python3
[[ -x pip ]] || ln -nfs "$PIP_BIN" pip
Expand All @@ -77,6 +79,10 @@
popd

# Install Python SSL certificates right away
env PATH="$INSTALLROOT/bin:$PATH" \
LD_LIBRARY_PATH="$INSTALLROOT/lib:$LD_LIBRARY_PATH" \
PYTHONHOME="$INSTALLROOT" \
which python3
env PATH="$INSTALLROOT/bin:$PATH" \
LD_LIBRARY_PATH="$INSTALLROOT/lib:$LD_LIBRARY_PATH" \
PYTHONHOME="$INSTALLROOT" \
Expand All @@ -93,6 +99,7 @@
-mindepth 2 -maxdepth 2 -type d -and \( -name test -or -name tests \) \
-exec rm -rvf '{}' \;


# Modulefile
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
Expand Down