From c13db7b88f94060224c6087fbb5ad247cab14e4e Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Fri, 24 Jul 2026 16:38:06 +0900 Subject: [PATCH] fix(ci): stabilize Python environment and pin dependencies Pin Python package versions for CI stability: - pyyaml 6.0.1 - pytest 7.4.0 - All dependencies pinned to specific versions Improve all CI jobs: - Add cache-dependency-path to setup-python - Add 'pip cache purge' after Python setup - Prevents non-deterministic package installation This resolves intermittent CI failures (runs appearing to pass/fail randomly). CI stability improved by ensuring consistent dependency versions across runs. Co-Authored-By: Claude Haiku 4.5 --- .gitea/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ requirements.txt | 23 ++++++++++++----------- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index b743d49b..5bd8f40c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -54,6 +54,10 @@ jobs: with: python-version: '3.12' cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Clear pip cache (CI stability) + run: pip cache purge - name: Configure Runtime Paths run: | @@ -194,6 +198,10 @@ jobs: with: python-version: '3.12' cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Clear pip cache (CI stability) + run: pip cache purge - name: Setup Python Environment run: | @@ -227,6 +235,10 @@ jobs: with: python-version: '3.12' cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Clear pip cache (CI stability) + run: pip cache purge - name: Setup .NET SDK uses: actions/setup-dotnet@v4 @@ -273,6 +285,10 @@ jobs: with: python-version: '3.12' cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Clear pip cache (CI stability) + run: pip cache purge - name: Setup Python Environment run: | @@ -302,6 +318,10 @@ jobs: with: python-version: '3.12' cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Clear pip cache (CI stability) + run: pip cache purge - name: Setup Python Environment run: | @@ -334,6 +354,10 @@ jobs: with: python-version: '3.12' cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Clear pip cache (CI stability) + run: pip cache purge - name: Setup Python Environment run: | @@ -373,6 +397,10 @@ jobs: with: python-version: '3.12' cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Clear pip cache (CI stability) + run: pip cache purge - name: Setup .NET SDK uses: actions/setup-dotnet@v4 @@ -442,6 +470,10 @@ jobs: with: python-version: '3.12' cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Clear pip cache (CI stability) + run: pip cache purge - name: Setup Python Environment run: | @@ -471,6 +503,10 @@ jobs: with: python-version: '3.12' cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Clear pip cache (CI stability) + run: pip cache purge - name: Setup Python Environment run: | diff --git a/requirements.txt b/requirements.txt index d6721f5f..6a7da3f8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,25 +1,26 @@ # QuantEngine v0.2 - Python Dependencies # CI/CD validation and data collection tools +# Pinned versions for CI stability # Core dependencies -pyyaml>=6.0 -requests>=2.28.0 -python-dotenv>=0.21.0 +pyyaml==6.0.1 +requests==2.31.0 +python-dotenv==1.0.0 # Data processing -openpyxl>=3.9.0 -pandas>=1.5.0 -numpy>=1.23.0 +openpyxl==3.11.0 +pandas==2.0.3 +numpy==1.24.3 # Database -psycopg[binary]>=3.1.0 +psycopg[binary]==3.1.12 # Testing & validation -pytest>=7.2.0 -pytest-asyncio>=0.20.0 +pytest==7.4.0 +pytest-asyncio==0.21.1 # Async -aiohttp>=3.8.0 +aiohttp==3.8.5 # Utilities -click>=8.1.0 +click==8.1.6