Skip to content

Commit

Permalink
Use requirements in GH workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
thomass-dev committed Jan 30, 2025
1 parent ed7ab7d commit 9b851f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand All @@ -97,20 +101,14 @@ 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"
python -m pip install --upgrade pip build
python -m pip install --requirement python-${PYTHON}-scikit-learn-${SCIKITLEARN}-test-requirements.txt
env:
PYTHON: ${{ matrix.python }}
SCIKITLEARN: ${{ matrix.scikit-learn }}

- name: Save python-venv
uses: actions/cache/save@v4
Expand All @@ -124,10 +122,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/
Expand Down
2 changes: 1 addition & 1 deletion skore/ci/pip-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set -eu

echo "Generating requirements: python ==${python} | scikit-learn ==${scikit_learn}"

python -m pip install pip pip-tools --quiet
python -m pip install --upgrade pip pip-tools --quiet
python -m piptools compile \
--quiet \
--no-strip-extras \
Expand Down

0 comments on commit 9b851f3

Please sign in to comment.