From 11f0ef5fbe89a7ea44bf69b1ed1219a7b8fcbae7 Mon Sep 17 00:00:00 2001 From: Oliver Lantwin Date: Tue, 19 May 2026 14:14:34 +0200 Subject: [PATCH] fix: use versioned Python sitepackages paths instead of symlinks Replace the unversioned lib/python symlink with direct use of versioned paths (e.g. lib/python3.12/site-packages) for robustness. --- alibuild.sh | 6 ++---- bitsorg.sh | 6 ++---- python-awkward-cpp.sh | 6 ++---- python-awkward.sh | 6 ++---- python-certifi.sh | 6 ++---- python-charset-normalizer.sh | 6 ++---- python-contourpy.sh | 6 ++---- python-cramjam.sh | 6 ++---- python-cycler.sh | 6 ++---- python-dateutil.sh | 6 ++---- python-distro.sh | 6 ++---- python-execnet.sh | 6 ++---- python-fonttools.sh | 6 ++---- python-fsspec.sh | 6 ++---- python-idna.sh | 6 ++---- python-iniconfig.sh | 6 ++---- python-jinja2.sh | 6 ++---- python-kiwisolver.sh | 6 ++---- python-markupsafe.sh | 6 ++---- python-matplotlib.sh | 6 ++---- python-numpy.sh | 6 ++---- python-packaging.sh | 6 ++---- python-pandas.sh | 6 ++---- python-pillow.sh | 6 ++---- python-pluggy.sh | 6 ++---- python-pygments.sh | 6 ++---- python-pyparsing.sh | 6 ++---- python-pytest-xdist.sh | 6 ++---- python-pytest.sh | 5 ++--- python-pyyaml.sh | 6 ++---- python-requests.sh | 6 ++---- python-scipy.sh | 6 ++---- python-six.sh | 6 ++---- python-tabulate.sh | 6 ++---- python-uproot.sh | 6 ++---- python-urllib3.sh | 6 ++---- python-xxhash.sh | 6 ++---- python.sh | 10 ++++------ xrootd.sh | 12 +++++------- 39 files changed, 83 insertions(+), 160 deletions(-) diff --git a/alibuild.sh b/alibuild.sh index b5a489b84..97c2dba62 100644 --- a/alibuild.sh +++ b/alibuild.sh @@ -18,7 +18,7 @@ prefer_system_check: | SYSTEM_VERSION=$(python3 -c 'import alibuild_helpers; print(alibuild_helpers.__version__)') printf '%s\n%s\n' "$PKGVERSION" "$SYSTEM_VERSION" | sort -V -C prepend_path: - PYTHONPATH: "$ALIBUILD_ROOT/lib/python/site-packages" + PYTHONPATH: "$ALIBUILD_ROOT/lib/python$(python3 -c 'import sysconfig; print(sysconfig.get_python_version())')/site-packages" PATH: "$ALIBUILD_ROOT/bin" --- #!/bin/bash -e @@ -28,8 +28,6 @@ mkdir -p "$TARGET" uv pip install --no-deps --no-cache-dir --target="$TARGET" --python="$(command -v python3)" "alibuild==$PKGVERSION" -ln -snf "python$pyver" "$INSTALLROOT/lib/python" - # Move scripts installed into the target to the bin directory mkdir -p "$INSTALLROOT/bin" mv "$TARGET/bin"/* "$INSTALLROOT/bin/" @@ -38,6 +36,6 @@ mkdir -p "$INSTALLROOT/etc/modulefiles" alibuild-generate-module > "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$INSTALLROOT/etc/modulefiles/$PKGNAME" cat >> "$INSTALLROOT/etc/modulefiles/$PKGNAME" < "$MODULEFILE" cat >> "$MODULEFILE" <>>>>> Found XRootD python bindings: " - LD_LIBRARY_PATH="$INSTALLROOT/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" PYTHONPATH="$INSTALLROOT/lib/python/site-packages${PYTHONPATH:+:}$PYTHONPATH" ${PYTHON_EXECUTABLE} -c 'from XRootD import client as xrd_client;print(f"{xrd_client.__version__}\n{xrd_client.__file__}");' + LD_LIBRARY_PATH="$INSTALLROOT/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" PYTHONPATH="$INSTALLROOT/lib/python${PYTHON_VER}/site-packages${PYTHONPATH:+:}$PYTHONPATH" ${PYTHON_EXECUTABLE} -c 'from XRootD import client as xrd_client;print(f"{xrd_client.__version__}\n{xrd_client.__file__}");' echo fi # end of PYTHON part @@ -108,7 +106,7 @@ alibuild-generate-module --bin --lib > "$MODULEFILE" cat >> "$MODULEFILE" <