superlint/dependencies/python/build-venvs.sh
Marco Ferrari 6a9eb04b8d
chore: update dependencies to unblock the build (#6589)
- Update the base system image to Alpine 3.21
- Update the Python runtime to 3.13
- Update PHP dependencies:

  - Update PHP from 8.3 to 8.4
  - Update composer from 2.8.3 to 2.8.5
  - Update PHP Codesniffer from 3.10 to 3.11
  - Update PHPStan from 2.0 to 2.1
  - Update Psalm from 5.24 to 6.8

- Update Clang from 17 to 19
2025-02-20 19:28:13 +01:00

55 lines
1.7 KiB
Bash
Executable file

#!/usr/bin/env bash
################################################################################
########################### Install Python Dependancies ########################
################################################################################
#####################
# Set fail on error #
#####################
set -euo pipefail
apk add --no-cache --virtual .python-build-deps \
gcc \
linux-headers \
musl-dev \
python3-dev
# Otherwise, pytries/datrie doesn't build using gcc14
# Ref: https://github.com/pytries/datrie/issues/101
export CFLAGS="-Wno-error=incompatible-pointer-types"
export CXXFLAGS="-Wno-error=incompatible-pointer-types"
############################
# Create staging directory #
############################
mkdir -p /venvs
########################################
# Install basic libs to run installers #
########################################
pip install virtualenv
#######################################################
# Iterate through requirments.txt to install binaries #
#######################################################
for DEP_FILE in *.txt; do
# split the package name from its version
PACKAGE_NAME=${DEP_FILE%.txt}
echo "-------------------------------------------"
mkdir -p "/venvs/${PACKAGE_NAME}"
cp "${DEP_FILE}" "/venvs/${PACKAGE_NAME}/requirements.txt"
echo "Generating virtualenv for: [${PACKAGE_NAME}]"
pushd "/venvs/${PACKAGE_NAME}"
virtualenv .
# shellcheck disable=SC1091
source bin/activate
pip install \
--no-cache-dir \
--requirement requirements.txt
# deactivate the python virtualenv
deactivate
# pop the stack
popd
done
apk del --no-network --purge .python-build-deps