Skip to content

Commit

Permalink
use uv dev dependencies, fix test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasertl committed Dec 14, 2024
1 parent 2ba7b72 commit 7c5c3f1
Show file tree
Hide file tree
Showing 7 changed files with 729 additions and 43 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
name: Code quality
on:
push:
env:
UV_SYSTEM_PYTHON: 1

jobs:

run:
runs-on: ubuntu-latest

steps:
- name: Acquire sources
uses: actions/[email protected]
Expand All @@ -21,13 +16,14 @@ jobs:
- name: Setup Python
uses: actions/[email protected]
with:
python-version: "3.12"
python-version: "3.13"
architecture: x64

- name: Install dev dependencies
run: uv pip install -r dev-requirements.txt
run: uv sync --python-preference only-system

- name: ruff format
run: uv run ruff format --diff .

- name: Run ruff
run: |
ruff format --diff .
ruff check --diff .
- name: ruff check
run: uv run ruff check --diff .
23 changes: 5 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: Tests
on:
push:
env:
UV_SYSTEM_PYTHON: 1
SOFTHSM2_CONF: /tmp/softhsm2.conf

jobs:

run:
runs-on: ubuntu-latest
strategy:
Expand All @@ -17,20 +12,12 @@ jobs:
- "3.11"
- "3.12"
- "3.12"
- "3.13"

steps:
- name: Install APT dependencies
run: sudo apt-get install -y softhsm2

- name: env
run: env

- name: id
run: id

- name: Create SoftHSM token
run: softhsm2-util --init-token --free --label TEST --pin 1234 --so-pin 5678

- name: Acquire sources
uses: actions/[email protected]

Expand All @@ -46,10 +33,10 @@ jobs:
architecture: x64

- name: Install the project
run: uv sync --all-extras --dev
run: uv sync --all-extras --python-preference only-system --python ${{ matrix.python-version }}

- name: Install dev dependencies
run: uv pip install -r dev-requirements.txt
- name: ls
run: ls /usr/lib/softhsm/libsofthsm2.so

- name: Run tests
run: uv run pytest -v
run: uv run --python ${{ matrix.python-version }} pytest -v tests/test_slots_and_tokens.py::test_get_mechanisms
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.13
3.13
11 changes: 0 additions & 11 deletions dev-requirements.txt

This file was deleted.

19 changes: 18 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=68.1", "wheel", "cython"]
requires = ["setuptools>=74.1", "wheel", "cython"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -22,6 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Security :: Cryptography",
]
dependencies = [
Expand Down Expand Up @@ -61,5 +62,21 @@ extend-select = [
[tool.ruff.lint.isort]
combine-as-imports = true

[tool.setuptools]
ext-modules = [
{name = "pkcs11._pkcs11", sources = ["pkcs11/_pkcs11.pyx"]}
]

[tool.setuptools.packages.find]
include = ["pkcs11*"]

[dependency-groups]
dev = [
"cryptography>=44.0.0",
"oscrypto>=1.3.0",
"pytest>=8.3.4",
"ruff>=0.8.3",
"setuptools-scm>=8.1.0",
"sphinx>=7.4.7",
"sphinx-rtd-theme>=3.0.2",
]
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

698 changes: 698 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 7c5c3f1

Please sign in to comment.