From 3ec36604552a0cda5e34b80d9a5611e231fc6904 Mon Sep 17 00:00:00 2001 From: Maksim Totmin Date: Wed, 8 Apr 2026 18:08:44 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B2=D0=B5=D1=80=D0=BD=D1=83=D0=BB=20t?= =?UTF-8?q?ar.gz,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20wheels=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20Python=203.9-3.14,=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - архив снова tar.gz (сохраняет chmod +x) - wheels для Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 - install.sh проверяет Python >= 3.10 перед установкой --- build.sh | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 9ea7cf9..95a100d 100755 --- a/build.sh +++ b/build.sh @@ -35,11 +35,26 @@ mkdir -p "$WHEELS_DIR" "$STAGE_DIR" "$DIST_DIR" # --- Step 1: Download wheel packages --- echo "[1/4] Downloading dependencies as wheel packages..." +# Download wheels for multiple Python versions to support different servers +PYTHON_VERSIONS="39 310 311 312 313 314" +echo " Downloading for Python versions: ${PYTHON_VERSIONS}" + +for pyver in $PYTHON_VERSIONS; do + python3 -m pip download \ + -r "$SCRIPT_DIR/requirements.txt" \ + --dest "$WHEELS_DIR" \ + --python-version "$pyver" \ + --only-binary=:all: \ + --quiet 2>/dev/null || true +done + +# Also download pure-python wheels (no version constraint) python3 -m pip download \ -r "$SCRIPT_DIR/requirements.txt" \ --dest "$WHEELS_DIR" \ - --quiet + --quiet 2>/dev/null || true +# Deduplicate (same file may be downloaded multiple times) WHEEL_COUNT=$(find "$WHEELS_DIR" -type f | wc -l) echo " Downloaded $WHEEL_COUNT packages:" find "$WHEELS_DIR" -type f -printf " %f\n" | sort @@ -84,6 +99,22 @@ cat > "$STAGE_DIR/install.sh" << 'INSTALL_SCRIPT' # ============================================================================= set -euo pipefail +# --- Check Python version --- +PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2>/dev/null || echo "0.0") +PYTHON_MAJOR=$(echo "$PYTHON_VERSION" | cut -d. -f1) +PYTHON_MINOR=$(echo "$PYTHON_VERSION" | cut -d. -f2) + +if [ "$PYTHON_MAJOR" -lt 3 ] || { [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -lt 10 ]; }; then + echo "ERROR: Python 3.10+ required, found Python ${PYTHON_VERSION}" >&2 + echo "" >&2 + echo "Install Python 3.10+:" >&2 + echo " RHEL/CentOS: yum install python3.11" >&2 + echo " ALT Linux: apt-get install python3" >&2 + echo " Debian: apt install python3.11" >&2 + exit 1 +fi +echo "Python version: ${PYTHON_VERSION} (OK)" + SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" INSTALL_DIR="/opt/airflow-monitor" SERVICE_USER="$(whoami)"