Skip to content

Commit

Permalink
use uv in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier committed Oct 16, 2024
1 parent 118df82 commit 56c4877
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest mypy ruff
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f dev_requirements.txt ]; then pip install -r dev_requirements.txt; fi
- name: Test with pytest
run: |
pytest -v -s
run: uv tool install mypy ruff
- name: Run tests
run: uv run pytest -v -s tests

lint:
runs-on: ubuntu-latest
Expand All @@ -45,10 +47,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies

- name: Install the project
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit
uv sync --all-extras --dev
uv tool install pre-commit
- name: Lint with ruff
run: |
pre-commit run -a
uvx pre-commit run -a
10 changes: 0 additions & 10 deletions dev_requirements.txt

This file was deleted.

18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
version = "1.1.5"
name = "asyncua"
Expand Down Expand Up @@ -31,6 +35,20 @@ dependencies = [
"wait_for2==0.3.2",
]

[tool.uv]
dev-dependencies = [
"pytest",
"pytest-asyncio == 0.21.2",
"coverage",
"pytest-cov",
"pytest-mock",
"asynctest",
"types-aiofiles",
"types-pyOpenSSL",
"types-python-dateutil",
"types-pytz",
]

[project.scripts]
uabrowse = "asyncua.tools:uals"
uacall = "asyncua.tools:uacall"
Expand Down

0 comments on commit 56c4877

Please sign in to comment.