-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use uv dev dependencies, fix test workflow
- Loading branch information
1 parent
7c5c3f1
commit fafc357
Showing
10 changed files
with
197 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/__pycache__ | ||
**/*.egg-info | ||
/pkcs11/*.c | ||
/pkcs11/*.so | ||
/build/ | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
name: Tests | ||
on: | ||
push: | ||
env: | ||
PKCS11_MODULE: /home/runner/lib/softhsm/libsofthsm2.so | ||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
python-version: | ||
|
@@ -15,8 +17,8 @@ jobs: | |
- "3.13" | ||
|
||
steps: | ||
- name: Install APT dependencies | ||
run: sudo apt-get install -y softhsm2 | ||
# - name: Install APT dependencies | ||
# run: sudo apt-get install -y gcc python3 python3-dev softhsm2 openssl | ||
|
||
- name: Acquire sources | ||
uses: actions/[email protected] | ||
|
@@ -32,11 +34,23 @@ 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 Softhsm | ||
run: | | ||
curl https://dist.opendnssec.org/source/softhsm-2.5.0.tar.gz | tar -zxv | ||
(cd softhsm-2.5.0 && ./configure --prefix=$HOME --disable-p11-kit --disable-gost && make all install CC="gcc" CXX="g++") | ||
find /home/runner | grep softhsm2-util | ||
- name: Install the project | ||
run: uv sync --all-extras --python-preference only-system --python ${{ matrix.python-version }} | ||
|
||
- name: ls | ||
run: ls /usr/lib/softhsm/libsofthsm2.so | ||
- name: test.py | ||
run: uv run --python ${{ matrix.python-version }} python test.py | ||
|
||
- name: Run tests | ||
run: uv run --python ${{ matrix.python-version }} pytest -v tests/test_slots_and_tokens.py::test_get_mechanisms | ||
run: PATH=/home/runner/bin:$PATH uv run --python ${{ matrix.python-version }} pytest -v tests/test_aes.py::test_encrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
Oops, something went wrong.