ci: ARM venv 설치 piwheels 사용 및 설치 완료 체크 강화
- numpy 먼저 설치 → pandas oldest-supported-numpy 1.17.3 소스빌드 방지 - piwheels.org ARM 사전빌드 휠로 소스 컴파일 없이 설치 - 버전 핀 완화: numpy>=1.20 / pandas>=1.5 (ARM 휠 가용 버전 수용) - venv 체크: pip 존재 여부 → numpy/pandas import 가능 여부로 변경 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+18
-7
@@ -37,18 +37,29 @@ jobs:
|
||||
- name: Setup Python Environment
|
||||
run: |
|
||||
VENV=/volume1/gitea/python_venv
|
||||
if [ ! -f "$VENV/bin/pip" ]; then
|
||||
echo "=== 최초 1회 venv 생성 및 패키지 설치 ==="
|
||||
/usr/bin/python3 -m venv "$VENV"
|
||||
# numpy import 가능 여부로 설치 완료 판단 (pip만 있어도 설치 실패일 수 있음)
|
||||
if ! "$VENV/bin/python" -c "import numpy, pandas, yaml" 2>/dev/null; then
|
||||
echo "=== venv 설치 (ARM 사전빌드 휠 사용) ==="
|
||||
# venv가 없으면 생성
|
||||
[ ! -f "$VENV/bin/pip" ] && /usr/bin/python3 -m venv "$VENV"
|
||||
"$VENV/bin/pip" install --upgrade pip --quiet
|
||||
"$VENV/bin/pip" install "numpy==1.24.4" "pandas==2.0.3" \
|
||||
yfinance pyyaml openpyxl --quiet --prefer-binary
|
||||
# piwheels: ARM(armv7l) 사전빌드 휠 저장소
|
||||
# numpy 먼저 설치 → pandas 빌드 시 oldest-supported-numpy 1.17.3 소스빌드 방지
|
||||
"$VENV/bin/pip" install --prefer-binary \
|
||||
--extra-index-url https://www.piwheels.org/simple/ \
|
||||
"numpy>=1.20,<2" --quiet
|
||||
"$VENV/bin/pip" install --prefer-binary \
|
||||
--extra-index-url https://www.piwheels.org/simple/ \
|
||||
"pandas>=1.5,<3" yfinance pyyaml openpyxl --quiet
|
||||
if [ -f requirements.txt ]; then
|
||||
"$VENV/bin/pip" install -r requirements.txt --quiet --prefer-binary
|
||||
"$VENV/bin/pip" install --prefer-binary \
|
||||
--extra-index-url https://www.piwheels.org/simple/ \
|
||||
-r requirements.txt --quiet
|
||||
fi
|
||||
"$VENV/bin/python" -c "import numpy, pandas; print('numpy', numpy.__version__, '/ pandas', pandas.__version__)"
|
||||
echo "venv 설치 완료"
|
||||
else
|
||||
echo "=== venv 재사용: $("$VENV/bin/python" --version 2>&1) ==="
|
||||
"$VENV/bin/python" -c "import numpy, pandas; print('=== venv 재사용:', 'numpy', numpy.__version__, '/ pandas', pandas.__version__, '===')"
|
||||
fi
|
||||
# 이후 모든 스텝에서 venv python 사용
|
||||
echo "$VENV/bin" >> $GITHUB_PATH
|
||||
|
||||
Reference in New Issue
Block a user