From 5dbf9034c880bfdb765a7a72ac9940002cb6be00 Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Fri, 26 Jul 2024 08:53:02 -0400 Subject: [PATCH] use conda for hpf tests --- .github/workflows/test.yml | 35 ++++++++++++++++++----------------- lkdev/workflows/test.py | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55af5d198..b6413561b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -467,6 +467,9 @@ jobs: name: HPF bridge tests on Python ${{matrix.python}} runs-on: ubuntu-latest timeout-minutes: 30 + defaults: + run: + shell: bash -el {0} strategy: fail-fast: false matrix: @@ -479,27 +482,25 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: 🐍 Set up Python - id: install-python + - name: 🐍 Setup bootstrap Python uses: actions/setup-python@v5 with: - python-version: ${{matrix.python}} - cache: pip - cache-dependency-path: | - requirements*.txt - */pyproject.toml - - name: 🕶️ Set up uv + python-version: '3.11' + - name: 👢 Generate Conda environment file run: | - pip install -U 'uv>=0.1.15' - - name: 📦 Set up Python dependencies - id: install-deps + pip install -e . + python -m lkdev.conda -o ci-environment.yml -e all requirements-test.txt lenskit/pyproject.toml lenskit-hpf/pyproject.toml + - id: setup + name: 📦 Set up Conda environment + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: ci-environment.yml + environment-name: lkpy + cache-environment: true + init-shell: bash + - name: 🍱 Install LensKit packages run: | - uv pip install --python $PYTHON -r requirements-test.txt -e lenskit -e lenskit-hpf - shell: bash - env: - PYTHON: ${{steps.install-python.outputs.python-path}} - UV_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu - UV_INDEX_STRATEGY: unsafe-first-match + pip install --no-deps -e lenskit -e lenskit-hpf - name: 🔍 Inspect environment run: | python -m lenskit.util.envcheck diff --git a/lkdev/workflows/test.py b/lkdev/workflows/test.py index bd5cc3f1b..038551630 100644 --- a/lkdev/workflows/test.py +++ b/lkdev/workflows/test.py @@ -431,7 +431,7 @@ def jobs_test_matrix() -> dict[str, GHJob]: "HPF bridge tests on Python ${{matrix.python}}", packages=["lenskit-hpf"], matrix={"python": PYTHONS}, - env="vanilla", + env="conda", ) ), "eval-tests": test_eval_job(),