From 2ae655c446911d7e4ea0cbf3f270e1473922b8d4 Mon Sep 17 00:00:00 2001 From: Thomas S Date: Thu, 30 Jan 2025 14:29:21 +0100 Subject: [PATCH] Use requirements in GH workflow --- .github/workflows/backend.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index a683a86ad..a1195ccb7 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -77,7 +77,11 @@ jobs: id: cache-python-venv with: path: 'skore/venv' - key: python-venv-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.scikit-learn }}-${{ hashFiles('skore/pyproject.toml') }} + key: >- + python-venv + -${{ matrix.os }} + -${{ matrix.python }} + -${{ hashFiles(format('skore/ci/requirements/python-{0}-scikit-learn-{1}-test-requirements.txt', matrix.python, matrix.scikit-learn) }} - name: Setup python-venv working-directory: "skore/" @@ -97,20 +101,12 @@ jobs: fi - name: Install dependencies in python-venv - working-directory: "skore/" + working-directory: skore/ci/requirements if: steps.cache-python-venv.outputs.cache-hit != 'true' - run: | - python -m pip install --upgrade "pip" - python -m pip install --upgrade "build" - # adding `.*` to the version ensures that we install the latest version of - # scikit-learn that is compatible with the specified version - python -m pip install --upgrade "scikit-learn ==${{ matrix.scikit-learn }}.*" - - # Install `skore` and its dependencies - python -m pip install --upgrade --upgrade-strategy=eager ".[test]" - - # Uninstall the `skore` package itself - python -m pip uninstall -y "skore" + run: python -m pip install pip build python-${PYTHON}-scikit-learn-${SCIKIT-LEARN}-test-requirements.txt + env: + PYTHON: ${{ matrix.python }} + SCIKIT-LEARN: ${{ matrix.scikit-learn }} - name: Save python-venv uses: actions/cache/save@v4 @@ -124,10 +120,8 @@ jobs: run: python -m build - name: Install - working-directory: skore/ - run: | - # Install `skore` without its dependencies, which are present in the venv - wheel=(dist/*.whl); python -m pip install --force-reinstall --no-deps "${wheel}" + working-directory: skore/dist/ + run: wheel=(*.whl); python -m pip install --force-reinstall --no-deps "${wheel}" - name: Show dependencies versions working-directory: skore/