Skip to content

Commit

Permalink
Try out testing with UV
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Jan 13, 2025
1 parent 8e2b230 commit f28beef
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,26 @@ jobs:
python: "['3.8', '3.9', '3.10', '3.11']"
needs:
- call-inclusive-naming-check

test-with-uv:
name: continuous-integration
runs-on: ubuntu-24.04
strategy:
matrix:
python-version:
- "3.8"
- "3.10"
- "3.12"
steps:
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install the project
run: uv sync --all-extras --dev

- name: Run tests
run:
tox -e unit,lint
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ tox
isort
black
types-PyYAML
uv
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
coverage
pytest
pytest-operator
uv
22 changes: 11 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ deps = -r{toxinidir}/requirements-dev.txt
[testenv:lint]
basepython = python3
commands =
codespell {[vars]all_path}
ruff check {[vars]all_path}
isort --check-only --diff {[vars]all_path}
black -l 99 --check --diff {[vars]all_path}
mypy --namespace-packages {[vars]src_path}
uvx codespell {[vars]all_path}
uvx ruff check {[vars]all_path}
uvx isort --check-only --diff {[vars]all_path}
uvx black -l 99 --check --diff {[vars]all_path}
uv run mypy --namespace-packages {[vars]src_path}

[testenv:unit]
basepython = python3
deps = -r{toxinidir}/requirements-test.txt
commands =
coverage run --source={toxinidir}/src -m pytest {toxinidir}/tests/unit/ {posargs}
coverage report -m --fail-under=97
uv run coverage run --source={toxinidir}/src -m pytest {toxinidir}/tests/unit/ {posargs}
uv run coverage report -m --fail-under=97

[testenv:integration]
basepython = python3
Expand All @@ -45,17 +45,17 @@ passenv =
TEST_HTTPS_PROXY
deps = -r{toxinidir}/requirements-test.txt
commands =
pytest --log-cli-level=INFO \
uv run pytest --log-cli-level=INFO \
--asyncio-mode=auto \
{posargs} \
{toxinidir}/tests/functional/

[testenv:format]
basepython = python3
commands =
isort {[vars]all_path}
black -l 99 {[vars]all_path}
ruff check --fix {[vars]all_path}
uvx isort {[vars]all_path}
uvx black -l 99 {[vars]all_path}
uvx ruff check --fix {[vars]all_path}

[testenv:update]
deps =
Expand Down

0 comments on commit f28beef

Please sign in to comment.