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 fa37a69
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 33 deletions.
59 changes: 36 additions & 23 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,58 @@ on:
branches: [master]

jobs:
build:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.13", "pypy-3.10"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
submodules: true

- name: Install uv
uses: astral-sh/setup-uv@v3

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

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

- name: Install the project
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
uv sync --all-extras --dev
uv tool install pre-commit
- name: Lint with ruff
run: |
pytest -v -s
uvx pre-commit run -a
lint:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.13", "pypy-3.10"]

steps:
- 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: "3.12"
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 pre-commit
- name: Lint with ruff
run: |
pre-commit run -a
uv tool install mypy
uv tool install ruff
- name: Run tests
run: uv run pytest -v -s tests
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 fa37a69

Please sign in to comment.