Skip to content

Commit

Permalink
pip install for test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Jul 2, 2024
1 parent e20c997 commit abeb934
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🐍 Setup bootstrap Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 👢 Generate Conda environment file
run: |
pipx run --python 3.11 --spec . lk-conda -o ci-environment.yml -e all requirements-test.txt lenskit/pyproject.toml
pip install -e .
python -m lkdev.conda -o ci-environment.yml -e all requirements-test.txt lenskit/pyproject.toml
- id: setup
name: 📦 Set up Conda environment
uses: mamba-org/setup-micromamba@v1
Expand Down Expand Up @@ -236,9 +241,14 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🐍 Setup bootstrap Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 👢 Generate Conda environment file
run: |
pipx run --python 3.11 --spec . lk-conda -o ci-environment.yml -e all requirements-test.txt lenskit/pyproject.toml lenskit-funksvd/pyproject.toml
pip install -e .
python -m lkdev.conda -o ci-environment.yml -e all requirements-test.txt lenskit/pyproject.toml lenskit-funksvd/pyproject.toml
- id: setup
name: 📦 Set up Conda environment
uses: mamba-org/setup-micromamba@v1
Expand Down Expand Up @@ -333,9 +343,14 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🐍 Setup bootstrap Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 👢 Generate Conda environment file
run: |
pipx run --python 3.11 --spec . lk-conda -o ci-environment.yml -e all requirements-test.txt lenskit/pyproject.toml lenskit-implicit/pyproject.toml
pip install -e .
python -m lkdev.conda -o ci-environment.yml -e all requirements-test.txt lenskit/pyproject.toml lenskit-implicit/pyproject.toml
- id: setup
name: 📦 Set up Conda environment
uses: mamba-org/setup-micromamba@v1
Expand Down Expand Up @@ -476,9 +491,14 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🐍 Setup bootstrap Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 👢 Generate Conda environment file
run: |
pipx run --python 3.11 --spec . lk-conda -o ci-environment.yml -e all requirements-test.txt lenskit/pyproject.toml lenskit-funksvd/pyproject.toml lenskit-implicit/pyproject.toml
pip install -e .
python -m lkdev.conda -o ci-environment.yml -e all requirements-test.txt lenskit/pyproject.toml lenskit-funksvd/pyproject.toml lenskit-implicit/pyproject.toml
- id: setup
name: 📦 Set up Conda environment
uses: mamba-org/setup-micromamba@v1
Expand Down Expand Up @@ -525,9 +545,14 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🐍 Setup bootstrap Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 👢 Generate Conda environment file
run: |
pipx run --python 3.11 --spec . lk-conda -o ci-environment.yml -e all requirements-test.txt requirements-demo.txt lenskit/pyproject.toml lenskit-funksvd/pyproject.toml lenskit-implicit/pyproject.toml
pip install -e .
python -m lkdev.conda -o ci-environment.yml -e all requirements-test.txt requirements-demo.txt lenskit/pyproject.toml lenskit-funksvd/pyproject.toml lenskit-implicit/pyproject.toml
- id: setup
name: 📦 Set up Conda environment
uses: mamba-org/setup-micromamba@v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ We recommend using an Anaconda environment for developing LensKit. We provide a
tool to automate setting up Conda environments from the LensKit dependencies; to
create a dev environment, checkout LensKit, then run:

pipx ./utils/conda-tool.py --env -n lkpy pyproject.toml dev-requirements.txt
pipx --spec . lk-conda -n lkpy pyproject.toml dev-requirements.txt
conda activate lkpy

That will create and activate an environment named `lkpy` with all the LensKit
Expand Down
14 changes: 12 additions & 2 deletions lkdev/workflows/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from ..ghactions import GHJob, GHStep, script

CODECOV_TOKEN = "5cdb6ef4-e80b-44ce-b88d-1402e4dfb781"
META_PYTHON = "3.11"
PYTHONS = ["3.10", "3.11", "3.12"]
PLATFORMS = ["ubuntu-latest", "macos-latest", "windows-latest"]
PACKAGES = ["lenskit", "lenskit-funksvd", "lenskit-implicit"]
Expand Down Expand Up @@ -105,21 +106,30 @@ def step_checkout(options: Optional[JobOptions] = None) -> GHStep:


def steps_setup_conda(options: JobOptions) -> list[GHStep]:
ctool = ["pipx run --python 3.11 --spec .", "lk-conda", "-o", "ci-environment.yml"]
ctool = ["python -m lkdev.conda", "-o", "ci-environment.yml"]
if options.extras:
for e in options.extras:
ctool += ["-e", e]
else:
ctool += ["-e", "all"]
ctool += options.req_files + [f"{pkg}/pyproject.toml" for pkg in options.required_packages]
conda_prep = " ".join(ctool)

pip = ["pip", "install", "--no-deps"]
pip += [f"-e {pkg}" for pkg in options.required_packages]

return [
{
"name": "🐍 Setup bootstrap Python",
"uses": "actions/setup-python@v5",
"with": {"python-version": META_PYTHON},
},
{
"name": "👢 Generate Conda environment file",
"run": script.command(ctool),
"run": script(f"""
pip install -e .
{conda_prep}
"""),
},
{
"id": "setup",
Expand Down

0 comments on commit abeb934

Please sign in to comment.