Skip to content

Commit

Permalink
Move test deps to pyproject.toml; use uv in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Nov 4, 2024
1 parent d6839ba commit 858fcbd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
cache: "pip"
cache-dependency-path: "**/requirements*txt"
- run: pip install -U pip setuptools wheel
- run: "pip install -e . -r requirements-test.txt"
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- run: uv pip install -e .[test]
- run: make test
env:
EMAIL: foo@example.com
Expand All @@ -54,7 +55,7 @@ jobs:
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "**/requirements*txt"
cache-dependency-path: "**/pyproject.toml"
- run: pip install build
- run: python -m build
- name: Upload artifact
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ dev:
ifndef UV
pip install -U pip
endif
$(PIP_INSTALL) -r requirements-test.txt
$(PIP_INSTALL) pre-commit
$(PIP_INSTALL) -e .
$(PIP_INSTALL) pre-commit -e .[test]
pre-commit install

.PHONY: lint
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ dependencies = [
"valohai-yaml>=0.43.0",
]

[project.optional-dependencies]
test = [
"pytest-cov~=4.0",
"pytest~=7.0",
"requests-mock~=1.10",
]

[project.scripts]
vh = "valohai_cli.cli:cli"

Expand Down
5 changes: 0 additions & 5 deletions requirements-test.txt

This file was deleted.

0 comments on commit 858fcbd

Please sign in to comment.