Skip to content

Commit d78ef40

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

File tree

3 files changed

+35
-22
lines changed

3 files changed

+35
-22
lines changed

.github/workflows/python-package.yml

+17-12
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,23 @@ jobs:
2121
- uses: actions/checkout@v4
2222
with:
2323
submodules: true
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v3
26+
2427
- name: Set up Python ${{ matrix.python-version }}
2528
uses: actions/setup-python@v5
2629
with:
2730
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install the project
33+
run: uv sync --all-extras --dev
34+
2835
- name: Install dependencies
2936
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
35-
run: |
36-
pytest -v -s
37+
uv tool install mypy
38+
uv tool install ruff
39+
- name: Run tests
40+
run: uv run pytest -v -s tests
3741

3842
lint:
3943
runs-on: ubuntu-latest
@@ -44,11 +48,12 @@ jobs:
4448
- name: Set up Python ${{ matrix.python-version }}
4549
uses: actions/setup-python@v5
4650
with:
47-
python-version: "3.12"
48-
- name: Install dependencies
51+
python-version: "3.13"
52+
53+
- name: Install the project
4954
run: |
50-
python -m pip install --upgrade pip
51-
python -m pip install pre-commit
55+
uv sync --all-extras --dev
56+
uv tool install pre-commit
5257
- name: Lint with ruff
5358
run: |
54-
pre-commit run -a
59+
uvx pre-commit run -a

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)