Skip to content

Commit cc1788d

Browse files
author
Olivier
committed
use uv in CI
1 parent 118df82 commit cc1788d

File tree

3 files changed

+52
-33
lines changed

3 files changed

+52
-33
lines changed

.github/workflows/python-package.yml

+34-23
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,56 @@ on:
1010
branches: [master]
1111

1212
jobs:
13-
build:
13+
lint:
1414
runs-on: ubuntu-latest
15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
python-version: ["3.10", "3.13", "pypy-3.10"]
19-
2015
steps:
21-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v3
2217
with:
2318
submodules: true
24-
- name: Set up Python ${{ matrix.python-version }}
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v3
22+
23+
- name: Set up Python
2524
uses: actions/setup-python@v5
2625
with:
27-
python-version: ${{ matrix.python-version }}
28-
- name: Install dependencies
26+
python-version: "3.13"
27+
28+
- name: Install the project
2929
run: |
30-
python -m pip install --upgrade pip
31-
python -m pip install pytest mypy ruff
32-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
33-
if [ -f dev_requirements.txt ]; then pip install -r dev_requirements.txt; fi
34-
- name: Test with pytest
30+
uv sync --all-extras --dev
31+
uv tool install pre-commit
32+
- name: Lint with ruff
3533
run: |
36-
pytest -v -s
34+
uvx pre-commit run -a
3735
38-
lint:
36+
build:
3937
runs-on: ubuntu-latest
38+
needs: lint
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
python-version: ["3.10", "3.13", "pypy-3.10"]
43+
4044
steps:
4145
- uses: actions/checkout@v4
4246
with:
4347
submodules: true
48+
49+
- name: Install uv
50+
uses: astral-sh/setup-uv@v3
51+
4452
- name: Set up Python ${{ matrix.python-version }}
4553
uses: actions/setup-python@v5
4654
with:
47-
python-version: "3.12"
55+
python-version: ${{ matrix.python-version }}
56+
57+
- name: Install the project
58+
run: uv sync --all-extras --dev
59+
4860
- name: Install dependencies
4961
run: |
50-
python -m pip install --upgrade pip
51-
python -m pip install pre-commit
52-
- name: Lint with ruff
53-
run: |
54-
pre-commit run -a
62+
uv tool install mypy
63+
uv tool install ruff
64+
- name: Run tests
65+
run: uv run pytest -v -s tests

dev_requirements.txt

-10
This file was deleted.

pyproject.toml

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
15
[project]
26
version = "1.1.5"
37
name = "asyncua"
@@ -31,6 +35,20 @@ dependencies = [
3135
"wait_for2==0.3.2",
3236
]
3337

38+
[tool.uv]
39+
dev-dependencies = [
40+
"pytest",
41+
"pytest-asyncio == 0.21.2",
42+
"coverage",
43+
"pytest-cov",
44+
"pytest-mock",
45+
"asynctest",
46+
"types-aiofiles",
47+
"types-pyOpenSSL",
48+
"types-python-dateutil",
49+
"types-pytz",
50+
]
51+
3452
[project.scripts]
3553
uabrowse = "asyncua.tools:uals"
3654
uacall = "asyncua.tools:uacall"

0 commit comments

Comments
 (0)