From 9f977934d1dee5f06f78b15f9c99da6e78685c7d Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Wed, 15 Apr 2026 18:49:20 +0800 Subject: [PATCH 1/6] [CI] add compatibility check to unit test --- .github/workflows/compatibility.yml | 23 +++------------- .github/workflows/unit_tests.yml | 41 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index 20f4fc1..8fcd3ab 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -10,40 +10,23 @@ permissions: contents: read jobs: - prepare: + prepare-compat: runs-on: ubuntu-latest outputs: versions: ${{ steps.parser.outputs.versions || '[]' }} steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 2 - - - name: Check license line changed - id: check - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - echo "changed=true" >> "$GITHUB_OUTPUT" - elif git diff HEAD~1 HEAD -- pyproject.toml | grep -q '^[+-].*license = "Apache-2.0"'; then - echo "changed=true" >> "$GITHUB_OUTPUT" - else - echo "changed=false" >> "$GITHUB_OUTPUT" - fi - - uses: actions/setup-python@v6 - if: steps.check.outputs.changed == 'true' with: python-version: "3.14" - name: Generate version matrix - if: steps.check.outputs.changed == 'true' id: parser run: | versions=$(python ci_loop_versions.py setuptools ">=77.0.1,<83") echo "versions=$versions" >> "$GITHUB_OUTPUT" - check: - needs: prepare + check-compat: + needs: prepare-compat if: needs.prepare.outputs.versions != '[]' runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 1a32509..c8b90d1 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -159,3 +159,44 @@ jobs: run: | mkdir -p artifacts pytest --durations=0 tests/${{ matrix.test_script }}.py --junitxml=artifacts/${{ runner.os }}-${{ matrix.test_script }}.xml + + prepare-compat: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.parser.outputs.versions || '[]' }} + steps: + - uses: actions/setup-python@v6 + with: + python-version: "3.14" + + - name: Generate version matrix + id: parser + run: | + versions=$(python ci_loop_versions.py setuptools ">=77.0.1,<83") + echo "versions=$versions" >> "$GITHUB_OUTPUT" + + check-compat: + needs: prepare-compat + if: needs.prepare.outputs.versions != '[]' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.prepare.outputs.versions) }} + + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: "3.14" + cache: pip + + - name: Install package with selected setuptools + run: | + python -m pip install --upgrade pip + python -m pip install . "setuptools==${{ matrix.version }}" + + - name: Show versions + run: | + python --version + python -m pip show setuptools From 3d5a557be83ca0bce2701e5c1c620d5a890a1401 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Wed, 15 Apr 2026 18:55:34 +0800 Subject: [PATCH 2/6] [CI] fix path --- .github/workflows/compatibility.yml | 2 +- .github/workflows/unit_tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index 8fcd3ab..43e7c86 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -22,7 +22,7 @@ jobs: - name: Generate version matrix id: parser run: | - versions=$(python ci_loop_versions.py setuptools ">=77.0.1,<83") + versions=$(python .github/scripts/ci_loop_versions.py setuptools ">=77.0.1,<83") echo "versions=$versions" >> "$GITHUB_OUTPUT" check-compat: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c8b90d1..4925e36 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -172,7 +172,7 @@ jobs: - name: Generate version matrix id: parser run: | - versions=$(python ci_loop_versions.py setuptools ">=77.0.1,<83") + versions=$(python .github/scripts/ci_loop_versions.py setuptools ">=77.0.1,<83") echo "versions=$versions" >> "$GITHUB_OUTPUT" check-compat: From 92f15170be2dbbefa5a70ebb8ee96359732c8506 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Wed, 15 Apr 2026 19:00:16 +0800 Subject: [PATCH 3/6] [CI] rename to setuptools --- .github/workflows/compatibility.yml | 6 +++--- .github/workflows/unit_tests.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index 43e7c86..8b8bca8 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -10,7 +10,7 @@ permissions: contents: read jobs: - prepare-compat: + prepare-setuptools: runs-on: ubuntu-latest outputs: versions: ${{ steps.parser.outputs.versions || '[]' }} @@ -25,8 +25,8 @@ jobs: versions=$(python .github/scripts/ci_loop_versions.py setuptools ">=77.0.1,<83") echo "versions=$versions" >> "$GITHUB_OUTPUT" - check-compat: - needs: prepare-compat + check-setuptools: + needs: prepare-setuptools if: needs.prepare.outputs.versions != '[]' runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 4925e36..5e76bc7 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -160,7 +160,7 @@ jobs: mkdir -p artifacts pytest --durations=0 tests/${{ matrix.test_script }}.py --junitxml=artifacts/${{ runner.os }}-${{ matrix.test_script }}.xml - prepare-compat: + prepare-setuptools: runs-on: ubuntu-latest outputs: versions: ${{ steps.parser.outputs.versions || '[]' }} @@ -175,8 +175,8 @@ jobs: versions=$(python .github/scripts/ci_loop_versions.py setuptools ">=77.0.1,<83") echo "versions=$versions" >> "$GITHUB_OUTPUT" - check-compat: - needs: prepare-compat + check-setuptools: + needs: prepare-setuptools if: needs.prepare.outputs.versions != '[]' runs-on: ubuntu-latest strategy: From 06b529444de94855912fdeac5993cf8a75fbc3f4 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Wed, 15 Apr 2026 19:05:00 +0800 Subject: [PATCH 4/6] [CI] fix needs reference --- .github/workflows/compatibility.yml | 4 ++-- .github/workflows/unit_tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index 8b8bca8..df9dffb 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -27,12 +27,12 @@ jobs: check-setuptools: needs: prepare-setuptools - if: needs.prepare.outputs.versions != '[]' + if: needs.prepare-setuptools.outputs.versions != '[]' runs-on: ubuntu-latest strategy: fail-fast: false matrix: - version: ${{ fromJSON(needs.prepare.outputs.versions) }} + version: ${{ fromJSON(needs.prepare-setuptools.outputs.versions) }} steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 5e76bc7..e0ecbce 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -177,12 +177,12 @@ jobs: check-setuptools: needs: prepare-setuptools - if: needs.prepare.outputs.versions != '[]' + if: needs.prepare-setuptools.outputs.versions != '[]' runs-on: ubuntu-latest strategy: fail-fast: false matrix: - version: ${{ fromJSON(needs.prepare.outputs.versions) }} + version: ${{ fromJSON(needs.prepare-setuptools.outputs.versions) }} steps: - uses: actions/checkout@v6 From a520689be646e9210f293f7a2ab14028d4a989ab Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Wed, 15 Apr 2026 19:08:54 +0800 Subject: [PATCH 5/6] [CI] restore checkout step --- .github/workflows/compatibility.yml | 1 + .github/workflows/unit_tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index df9dffb..7789e36 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -15,6 +15,7 @@ jobs: outputs: versions: ${{ steps.parser.outputs.versions || '[]' }} steps: + - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: python-version: "3.14" diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index e0ecbce..9903766 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -165,6 +165,7 @@ jobs: outputs: versions: ${{ steps.parser.outputs.versions || '[]' }} steps: + - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: python-version: "3.14" From d11460fc709a6ff938a8f9b9a700659c9aacf7e6 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Wed, 15 Apr 2026 19:12:37 +0800 Subject: [PATCH 6/6] [CI] fix requests & packaging --- .github/workflows/compatibility.yml | 1 + .github/workflows/unit_tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index 7789e36..f48cb5a 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -23,6 +23,7 @@ jobs: - name: Generate version matrix id: parser run: | + python -m pip install --upgrade requests packaging versions=$(python .github/scripts/ci_loop_versions.py setuptools ">=77.0.1,<83") echo "versions=$versions" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 9903766..75035c9 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -173,6 +173,7 @@ jobs: - name: Generate version matrix id: parser run: | + python -m pip install --upgrade requests packaging versions=$(python .github/scripts/ci_loop_versions.py setuptools ">=77.0.1,<83") echo "versions=$versions" >> "$GITHUB_OUTPUT"