From f8ba9677dd8b3defec41816a7468e4c4fd19fa57 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 6 Sep 2024 12:40:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Get=20rid=20of=20the=20old=20man?= =?UTF-8?q?ylinux=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They haven't been in use for quite a while, since we have moved to `cibuildwheel`. Closes #980 --- tools/build-wheels.sh | 92 ------------------------------------------- tools/run_docker.sh | 40 ------------------- 2 files changed, 132 deletions(-) delete mode 100755 tools/build-wheels.sh delete mode 100755 tools/run_docker.sh diff --git a/tools/build-wheels.sh b/tools/build-wheels.sh deleted file mode 100755 index db27dfb3..00000000 --- a/tools/build-wheels.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -if [ -n "$DEBUG" ] -then - set -x -fi - -package_name="$1" -if [ -z "$package_name" ] -then - >&2 echo "Please pass package name as a first argument of this script ($0)" - exit 1 -fi - -export WORKDIR_PATH="${GITHUB_WORKSPACE:-/io}" - -BUILD_DIR=`mktemp -d "/tmp/${package_name}-manylinux2010-build.XXXXXXXXXX"` -ORIG_WHEEL_DIR="${BUILD_DIR}/original-wheelhouse" -SRC_DIR="${BUILD_DIR}/src" -WHEELHOUSE_DIR="${WORKDIR_PATH}/dist" - -set -euo pipefail -# ref: https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail - -PYTHON_VERSIONS="cp36-cp36m cp37-cp37m" - -# Avoid creation of __pycache__/*.py[c|o] -export PYTHONDONTWRITEBYTECODE=1 - -arch=`uname -m` - -echo -echo -echo "Copying source to ${SRC_DIR}..." -cp -a "${WORKDIR_PATH}" "${SRC_DIR}" - -echo -echo -echo "Removing pre-existing ${SRC_DIR}/dist..." -rm -rfv "${SRC_DIR}/dist" - -echo -echo -echo "Building ${package_name} dist has been requested" - -echo -echo -echo "Compile wheels" -for PYTHON in ${PYTHON_VERSIONS}; do - /opt/python/${PYTHON}/bin/python -m pip install -U pip - /opt/python/${PYTHON}/bin/python -m pip install -r "${WORKDIR_PATH}/requirements/wheel.txt" - PIP_CONSTRAINT="${WORKDIR_PATH}/requirements/cython.txt" \ - /opt/python/${PYTHON}/bin/python -m pip wheel "${SRC_DIR}/" \ - --config-settings=pure-python=false \ - --no-deps \ - -w "${ORIG_WHEEL_DIR}/${PYTHON}" -done - -echo -echo -echo "Bundle external shared libraries into the wheels" -for whl in ${ORIG_WHEEL_DIR}/*/${package_name}-*-linux_${arch}.whl; do - echo "Repairing $whl..." - auditwheel repair "$whl" -w "${WHEELHOUSE_DIR}" -done - -echo -echo -echo "Cleanup OS specific wheels" -rm -fv ${WHEELHOUSE_DIR}/*-linux_*.whl - -echo -echo -echo "Cleanup non-$package_name wheels" -find "${WHEELHOUSE_DIR}" -maxdepth 1 -type f ! -name "$package_name"'-*-manylinux2010_*.whl' -print0 | xargs -0 rm -rf - -echo -echo -echo "Install packages and test" -echo "dist directory:" -ls ${WHEELHOUSE_DIR} - -for PYTHON in ${PYTHON_VERSIONS}; do - # clear python cache - find "${WORKDIR_PATH}" -type d -name __pycache__ -print0 | xargs -0 rm -rf - - echo - echo -n "Test $PYTHON: " - /opt/python/${PYTHON}/bin/python -c "import platform; print('Building wheel for {platform} platform.'.format(platform=platform.platform()))" - /opt/python/${PYTHON}/bin/pip install -r ${WORKDIR_PATH}/requirements/ci-wheel.txt - /opt/python/${PYTHON}/bin/pip install "$package_name" --no-index -f "file://${WHEELHOUSE_DIR}" - /opt/python/${PYTHON}/bin/py.test ${WORKDIR_PATH}/tests -done diff --git a/tools/run_docker.sh b/tools/run_docker.sh deleted file mode 100755 index 78a6510e..00000000 --- a/tools/run_docker.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -package_name="$1" -if [ -z "$package_name" ] -then - >&2 echo "Please pass package name as a first argument of this script ($0)" - exit 1 -fi - -manylinux1_image_prefix="quay.io/pypa/manylinux2010_" -dock_ext_args="" -declare -A docker_pull_pids=() # This syntax requires at least bash v4 - -for arch in x86_64 i686 -do - docker pull "${manylinux1_image_prefix}${arch}" & - docker_pull_pids[$arch]=$! -done - -echo Creating dist folder with privileges of host-machine user -mkdir -p dist # This is required to be created with host-machine user privileges - -for arch in x86_64 i686 -do - echo - echo - arch_pull_pid=${docker_pull_pids[$arch]} - echo Waiting for docker pull PID $arch_pull_pid to complete downloading container for $arch arch... - wait $arch_pull_pid # await for docker image for current arch to be pulled from hub - [ $arch == "i686" ] && dock_ext_args="linux32" - - echo Building wheel for $arch arch - docker run --rm -v `pwd`:/io "${manylinux1_image_prefix}${arch}" $dock_ext_args /io/tools/build-wheels.sh "$package_name" - - dock_ext_args="" # Reset docker args, just in case -done - -set +u