Skip to content

Commit 898cf52

Browse files
committed
fix replacing pytest and pyproject.toml
1 parent 71601e1 commit 898cf52

3 files changed

Lines changed: 16 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,19 @@ jobs:
2121
- if: ${{ matrix.os == 'ubuntu' }}
2222
run: sudo apt-get install strace
2323
- uses: actions/checkout@v4
24+
- uses: astral-sh/setup-uv@v5
2425
- uses: actions/setup-python@v5
2526
with:
2627
python-version: ${{ matrix.python-version }}
27-
28-
# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
29-
- id: pip-cache
30-
shell: bash
31-
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
32-
33-
- uses: actions/cache@v4
34-
with:
35-
path: ${{ steps.pip-cache.outputs.dir }}
36-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'dev_requirements.txt') }}
37-
restore-keys: |
38-
${{ runner.os }}-pip-${{ matrix.python-version }}-
39-
${{ runner.os }}-pip-
40-
- run: pip install . -r dev_requirements.txt
28+
- run: uv sync --group dev
4129
# PyPy bundles cffi which declares pycparser as dependency but doesn't ship it
4230
- if: ${{ startsWith(matrix.python-version, 'pypy') }}
43-
run: pip install pycparser
44-
- run: pip freeze
45-
- run: pip check
46-
- run: doit pyflakes
47-
- run: doit codestyle
48-
- run: py.test -vv ${{ matrix.pytest-args }}
31+
run: uv pip install pycparser
32+
- run: uv run doit pyflakes
33+
- run: uv run doit codestyle
34+
- run: uv run rut -vv
4935
- if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.11' }}
50-
run: doit coverage
36+
run: uv run doit coverage
5137
- if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.11' }}
5238
uses: codecov/codecov-action@v4
5339
with:

.github/workflows/website.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
steps:
1313
- run: sudo apt-get install hunspell hunspell-en-us
1414
- uses: actions/checkout@v4
15+
- uses: astral-sh/setup-uv@v5
1516
- uses: actions/setup-python@v5
1617
with:
1718
python-version: "3.12"
18-
- run: pip install . -r doc_requirements.txt -r dev_requirements.txt
19-
- run: pip freeze
20-
- run: doit -v2 website
19+
- run: uv sync --group dev --group docs
20+
- run: uv run doit -v2 website
2121
- uses: actions/upload-artifact@v4
2222
with:
2323
name: Website

dodo.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import os
55
import subprocess
66

7-
import pytest
87
from pyflakes.api import checkPath
98

109

@@ -33,23 +32,21 @@ def task_pyflakes():
3332
'file_dep': [py_file],
3433
}
3534

36-
def run_test(test):
37-
return not bool(pytest.main([test]))
3835
def task_ut():
3936
"""run unit-tests"""
40-
for test in TEST_FILES:
41-
yield {'name': test,
42-
'actions': [(run_test, (test,))],
43-
'file_dep': PY_FILES,
44-
'verbosity': 0}
37+
return {
38+
'actions': ['rut -c'],
39+
'file_dep': PY_FILES,
40+
'verbosity': 2,
41+
}
4542

4643

4744
def _coverage_actions(modules, test=None):
4845
"""build coverage run/combine/report commands"""
4946
omit = ['tests/myecho.py', 'tests/sample_process.py']
5047
actions = [
5148
'coverage run --parallel-mode --concurrency multiprocessing'
52-
' `which py.test`' + (' ' + test if test else ''),
49+
' `which rut`' + (' ' + test if test else ''),
5350
'coverage combine',
5451
'coverage report --show-missing --omit {} {}'.format(
5552
','.join(omit), ' '.join(modules)),

0 commit comments

Comments
 (0)