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 23, 2024
1 parent 987b8a3 commit 3ac401d
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 47 deletions.
57 changes: 34 additions & 23 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,56 @@ 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: Set up Python ${{ matrix.python-version }}

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
python-version: "3.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
needs: lint
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "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.

53 changes: 39 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
dependencies = [
"aiofiles",
"aiosqlite",
"cryptography>42.0.0",
"pyOpenSSL>23.2.0",
"python-dateutil",
"pytz",
"sortedcontainers",
"typing-extensions",
"wait_for2==0.3.2;python_version<'3.12'",
]

version = "1.1.5"
name = "asyncua"
description = "Pure Python OPC-UA client and server library"
requires-python = ">=3.10"
requires-python = ">=3.9"
readme = "README.md"
license = { text = "GNU Lesser General Public License v3 or later" }
authors = [
Expand All @@ -13,22 +29,27 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"aiofiles",
"aiosqlite",
"cryptography>42.0.0",
"pyOpenSSL>23.2.0",
"python-dateutil",
"pytz",
"sortedcontainers",
"typing-extensions",
"wait_for2==0.3.2",

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

[project.scripts]
Expand All @@ -46,9 +67,13 @@ uawrite = "asyncua.tools:uawrite"

[project.urls]
Homepage = "http://freeopcua.github.io/"

[tool.hatch.version]
path = "asyncua/__init__.py"
Repository = "https://github.com/FreeOpcUa/opcua-asyncio"

[tool.hatch.build.targets.sdist]
include = ["/asyncua"]


[tool.ruff]
line-length = 120
[tool.ruff.format]
quote-style = "preserve"

0 comments on commit 3ac401d

Please sign in to comment.