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 7c5c3f1 commit 34c635e
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 181 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/__pycache__
**/*.egg-info
/pkcs11/*.c
/pkcs11/*.so
/build/
/dist/
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
jobs:
run:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
Expand All @@ -16,7 +16,7 @@ jobs:

steps:
- name: Install APT dependencies
run: sudo apt-get install -y softhsm2
run: sudo apt-get install -y gcc python3 python3-dev softhsm2 openssl

- name: Acquire sources
uses: actions/[email protected]
Expand All @@ -32,6 +32,12 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Create venv
run: uv venv --python-preference only-system --python ${{ matrix.python-version }}

- name: Update setuptools
run: uv pip install setuptools

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

Expand Down
21 changes: 21 additions & 0 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG IMAGE=debian:stable
FROM $IMAGE

RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install -y gcc python3 python3-dev softhsm2 openssl && \
rm -rf /var/lib/apt/lists/*

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

WORKDIR /test

ADD uv.lock pyproject.toml .
ADD pkcs11/ pkcs11/
ADD extern/ extern/

ENV UV_LINK_MODE=copy
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --all-extras

ADD tests/ tests/
CMD ["uv", "run", "pytest", "-v"]
Loading

0 comments on commit 34c635e

Please sign in to comment.