Skip to content

Commit 41748ea

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

File tree

3 files changed

+54
-33
lines changed

3 files changed

+54
-33
lines changed

.github/workflows/python-package.yml

+36-23
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,58 @@ 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
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v3
22+
23+
- name: Install the project
24+
run: uv sync --all-extras --dev
25+
2426
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v4
2628
with:
27-
python-version: ${{ matrix.python-version }}
28-
- name: Install dependencies
29+
python-version: "3.13"
30+
31+
- name: Install the project
2932
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
33+
uv sync --all-extras --dev
34+
uv tool install pre-commit
35+
- name: Lint with ruff
3536
run: |
36-
pytest -v -s
37+
uvx pre-commit run -a
3738
38-
lint:
39+
build:
3940
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
python-version: ["3.10", "3.13", "pypy-3.10"]
45+
4046
steps:
4147
- uses: actions/checkout@v4
4248
with:
4349
submodules: true
50+
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@v3
53+
4454
- name: Set up Python ${{ matrix.python-version }}
4555
uses: actions/setup-python@v5
4656
with:
47-
python-version: "3.12"
57+
python-version: ${{ matrix.python-version }}
58+
59+
- name: Install the project
60+
run: uv sync --all-extras --dev
61+
4862
- name: Install dependencies
4963
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
64+
uv tool install mypy
65+
uv tool install ruff
66+
- name: Run tests
67+
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)