diff --git a/.github/actions/test-setup/action.yml b/.github/actions/test-setup/action.yml new file mode 100644 index 0000000..f6413e5 --- /dev/null +++ b/.github/actions/test-setup/action.yml @@ -0,0 +1,87 @@ +name: test-setup +author: Matthias Valvekens +description: Perform set-up for python-pkcs11 CI +inputs: + os: + description: OS to target + required: true + python-version: + description: Python version to target + required: true + dependency-group: + description: UV dependency group to install + required: true + pkcs11-platform: + description: PKCS#11 platform to target + required: true + token-label: + description: Label assigned to the token + required: true + token-user-pin: + description: User PIN to configure on the token + required: true + token-so-pin: + description: Security officer PIN to configure on the token + required: true +outputs: + module: + description: Path to PKCS#11 module + value: ${{ steps.install-result.outputs.module }} + module2: + description: Path to alternative PKCS#11 module ('multi' only) + value: ${{ steps.install-result.outputs.module2 }} +runs: + using: "composite" + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + - uses: ./.github/actions/install-softhsm + if: inputs.pkcs11-platform == 'softhsm' || inputs.pkcs11-platform == 'multi' + id: softhsm + with: + os: ${{ inputs.os }} + token-label: ${{ inputs.token-label }} + token-so-pin: ${{ inputs.token-so-pin }} + token-user-pin: ${{ inputs.token-user-pin }} + - uses: ./.github/actions/install-opencryptoki + # only run opencryptoki tests on ubuntu + # (macos and windows don't seem to be supported) + if: inputs.pkcs11-platform == 'opencryptoki' || inputs.pkcs11-platform == 'multi' + id: opencryptoki + with: + os: ${{ inputs.os }} + token-label: ${{ inputs.token-label }} + token-so-pin: ${{ inputs.token-so-pin }} + token-user-pin: ${{ inputs.token-user-pin }} + - name: Set module path + id: install-result + shell: bash + run: | + if [[ "$PLATFORM" == 'opencryptoki' ]]; then + echo "module=${{ steps.opencryptoki.outputs.module }}" >> "$GITHUB_OUTPUT" + elif [[ "$PLATFORM" == 'softhsm' ]]; then + echo "module=${{ steps.softhsm.outputs.module }}" >> "$GITHUB_OUTPUT" + elif [[ "$PLATFORM" == 'multi' ]]; then + # NOTE: the 'multi' platform is only used for testing the code that + # swaps between multiple PKCS#11 implementations. As such, any two + # PKCS#11 implementations will do. If we add a 3rd platform + # to the CI at a later stage that is faster to install than opencryptoki, + # switching is an option. + echo "module=${{ steps.softhsm.outputs.module }}" >> "$GITHUB_OUTPUT" + echo "module2=${{ steps.opencryptoki.outputs.module }}" >> "$GITHUB_OUTPUT" + else + echo "$PLATFORM is not a valid PKCS#11 platform choice" + exit 1 + fi + env: + PLATFORM: ${{ inputs.pkcs11-platform }} + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + python-version: ${{ inputs.python-version }} + - name: Install testing dependencies + shell: bash + run: uv sync --no-dev --exact --group "${{ inputs.dependency-group }}" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..6d35450 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,99 @@ +name: Coverage +on: + pull_request: {} + workflow_dispatch: {} +env: + UV_PYTHON_PREFERENCE: only-system + UV_NO_SYNC: "1" + PKCS11_TOKEN_LABEL: "TEST" + PKCS11_TOKEN_PIN: "1234" + PKCS11_TOKEN_SO_PIN: "5678" +jobs: + # For now, we run the coverage as a separate job. + # At the time of writing, the latest version of Cython's line tracing + # seems to lead to segfaults in Python 3.13 -> TODO: investigate + pytest-coverage: + runs-on: ubuntu-latest + strategy: + matrix: + pkcs11-platform: + - softhsm + - opencryptoki + steps: + - name: Acquire sources + uses: actions/checkout@v4 + - name: Arm coverage-only compiler directives + # Unfortunately, it doesn't seem to be possible to pass directives + # to Cython through environment variables: https://github.com/cython/cython/issues/3930 + # Doing it here is still better than introducing a non-declarative setup.py into the + # build again. + run: sed -i 's/#coverage#cython/#cython/g' pkcs11/*.pyx + - uses: ./.github/actions/test-setup + id: setup + with: + os: ubuntu-latest + python-version: "3.12" + dependency-group: coverage + token-label: ${{ env.PKCS11_TOKEN_LABEL }} + token-so-pin: ${{ env.PKCS11_TOKEN_SO_PIN }} + token-user-pin: ${{ env.PKCS11_TOKEN_PIN }} + pkcs11-platform: ${{ matrix.pkcs11-platform }} + env: + CFLAGS: "-DCYTHON_TRACE_NOGIL=1" + EXT_BUILD_DEBUG: "1" + - name: Run tests + run: uv run pytest -v --cov=pkcs11 --cov-branch --cov-report=xml:${{ matrix.pkcs11-platform }}-coverage.xml + env: + PKCS11_MODULE: ${{ steps.setup.outputs.module }} + - name: Stash coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-${{ strategy.job-index }} + path: "*-coverage.xml" + pytest-coverage-multilib: + runs-on: ubuntu-latest + steps: + - name: Acquire sources + uses: actions/checkout@v4 + - uses: ./.github/actions/test-setup + id: setup + with: + os: ubuntu-latest + pkcs11-platform: multi + token-label: ${{ env.PKCS11_TOKEN_LABEL }} + token-so-pin: ${{ env.PKCS11_TOKEN_SO_PIN }} + token-user-pin: ${{ env.PKCS11_TOKEN_PIN }} + python-version: "3.12" + dependency-group: coverage + - name: Run tests + run: uv run pytest -v --cov=pkcs11 --cov-branch --cov-report=xml:multilib-coverage.xml tests/test_multilib.py + env: + PKCS11_MODULE: ${{ steps.setup.outputs.module }} + PKCS11_MODULE2: ${{ steps.setup.outputs.module2 }} + - name: Stash coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-multilib + path: "*-coverage.xml" + codecov-upload: + permissions: + actions: write + contents: read + runs-on: ubuntu-latest + needs: [pytest-coverage] + steps: + # checkout necessary to ensure the uploaded report contains the correct paths + - uses: actions/checkout@v4 + - name: Retrieve coverage reports + uses: actions/download-artifact@v4 + with: + pattern: coverage-* + path: ./reports/ + - name: Upload all coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./reports/ + flags: unittests + env_vars: OS,PYTHON + name: codecov-umbrella diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7aab7c0..6fe1ea9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ env: PKCS11_TOKEN_PIN: "1234" PKCS11_TOKEN_SO_PIN: "5678" jobs: - run: + tests: runs-on: ${{ matrix.os }} strategy: # Our test suite is pretty fast, so fail-fast: false allows for better troubleshooting. @@ -27,46 +27,59 @@ jobs: - "3.11" - "3.12" - "3.13" + pkcs11-platform: + - softhsm + - opencryptoki + exclude: + # only run opencryptoki tests on ubuntu + # (macos and windows don't seem to be supported) + - pkcs11-platform: opencryptoki + os: windows-latest + - pkcs11-platform: opencryptoki + os: macos-latest steps: - name: Acquire sources uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - uses: ./.github/actions/install-softhsm - id: softhsm + - uses: ./.github/actions/test-setup + id: setup with: os: ${{ matrix.os }} token-label: ${{ env.PKCS11_TOKEN_LABEL }} token-so-pin: ${{ env.PKCS11_TOKEN_SO_PIN }} token-user-pin: ${{ env.PKCS11_TOKEN_PIN }} - - uses: ./.github/actions/install-opencryptoki - # only run opencryptoki tests on ubuntu - # (macos and windows don't seem to be supported) - if: matrix.os == 'ubuntu-latest' - id: opencryptoki + python-version: ${{ matrix.python-version }} + pkcs11-platform: ${{ matrix.pkcs11-platform }} + dependency-group: testing + - name: Run tests + run: uv run pytest -v + env: + PKCS11_MODULE: ${{ steps.setup.outputs.module }} + multilib-tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + steps: + - name: Acquire sources + uses: actions/checkout@v4 + - uses: ./.github/actions/test-setup + id: setup with: - os: ${{ matrix.os }} + os: ubuntu-latest + pkcs11-platform: multi token-label: ${{ env.PKCS11_TOKEN_LABEL }} token-so-pin: ${{ env.PKCS11_TOKEN_SO_PIN }} token-user-pin: ${{ env.PKCS11_TOKEN_PIN }} - - name: Install uv - uses: astral-sh/setup-uv@v4 - with: - enable-cache: true python-version: ${{ matrix.python-version }} - - name: Install testing dependencies - run: uv sync --no-dev --exact --group testing - - name: Run tests with SoftHSM - run: uv run pytest -v - env: - PKCS11_MODULE: ${{ steps.softhsm.outputs.module }} - - name: Run tests with opencryptoki - if: matrix.os == 'ubuntu-latest' - run: uv run pytest -v + dependency-group: testing + - name: Run tests + run: uv run pytest -v tests/test_multilib.py env: - PKCS11_MODULE: ${{ steps.opencryptoki.outputs.module }} - # For testing logic around swapping PKCS#11 libs - PKCS11_MODULE2: ${{ steps.softhsm.outputs.module }} + PKCS11_MODULE: ${{ steps.setup.outputs.module }} + PKCS11_MODULE2: ${{ steps.setup.outputs.module2 }} diff --git a/.gitignore b/.gitignore index 881d4d3..d2b97a8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ __pycache__ /dist/ /docs/_build /python_pkcs11.egg-info/ -/.eggs/ \ No newline at end of file +/.eggs/ +.coverage +*coverage.xml +*.html diff --git a/pkcs11/_pkcs11.pxd b/pkcs11/_pkcs11.pxd index dcba317..ba1903d 100644 --- a/pkcs11/_pkcs11.pxd +++ b/pkcs11/_pkcs11.pxd @@ -4,7 +4,6 @@ Definitions imported from PKCS11 C headers. from cython.view cimport array -from pkcs11.defaults import * from pkcs11.exceptions import * cdef extern from '../extern/cryptoki.h': @@ -638,10 +637,11 @@ cdef inline CK_ULONG_buffer(length): return array(shape=(length,), itemsize=sizeof(CK_ULONG), format='L') -cdef inline object map_rv_to_error( - CK_RV rv -): +# Note: this `cdef inline` declaration doesn't seem to be consistently labelled +# as executed by Cython's line tracing, so we flag it as nocover +# to avoid noise in the metrics. +cdef inline object map_rv_to_error(CK_RV rv): # pragma: nocover if rv == CKR_ATTRIBUTE_TYPE_INVALID: exc = AttributeTypeInvalid() elif rv == CKR_ATTRIBUTE_VALUE_INVALID: diff --git a/pkcs11/_pkcs11.pyx b/pkcs11/_pkcs11.pyx index feb43c0..84b5973 100644 --- a/pkcs11/_pkcs11.pyx +++ b/pkcs11/_pkcs11.pyx @@ -1,5 +1,5 @@ -#!python #cython: language_level=3 +#coverage#cython: linetrace=True """ High-level Python PKCS#11 Wrapper. diff --git a/pyproject.toml b/pyproject.toml index e4faa48..2be60df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,12 +67,35 @@ archs = ["universal2"] [tool.setuptools.packages.find] include = ["pkcs11*"] +[tool.coverage.run] +plugins = ["Cython.Coverage"] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "pragma: nocover", + "raise AssertionError", + "raise NotImplementedError", + "raise MemoryError", + "raise TypeError", + "TYPE_CHECKING", + "^\\s*\\.\\.\\.", + "noqa" +] +precision = 2 + [dependency-groups] testing = [ "cryptography>=44.0.0", "parameterized>=0.9.0", "pytest>=8.3.4", ] +coverage = [ + { include-group = "testing" }, + "coverage>=7.9.1", + "pytest-cov>=4.0,<6.3", + "cython", +] docs = [ "sphinx>=7.4.7", "sphinx-rtd-theme>=3.0.2", diff --git a/tests/test_multilib.py b/tests/test_multilib.py new file mode 100644 index 0000000..ba52f97 --- /dev/null +++ b/tests/test_multilib.py @@ -0,0 +1,26 @@ +""" +PKCS#11 Slots and Tokens +""" + +import os +import unittest + +import pkcs11 + +from . import LIB + + +@unittest.skipUnless("PKCS11_MODULE2" in os.environ, "Requires an additional PKCS#11 module") +class MultilibTests(unittest.TestCase): + def test_double_initialise_different_libs(self): + lib1 = pkcs11.lib(LIB) + lib2 = pkcs11.lib(os.environ["PKCS11_MODULE2"]) + self.assertIsNotNone(lib1) + self.assertIsNotNone(lib2) + self.assertIsNot(lib1, lib2) + + slots1 = lib1.get_slots() + slots2 = lib2.get_slots() + + self.assertGreaterEqual(len(slots1), 1) + self.assertGreaterEqual(len(slots2), 1) diff --git a/tests/test_slots_and_tokens.py b/tests/test_slots_and_tokens.py index a513b41..37defd1 100644 --- a/tests/test_slots_and_tokens.py +++ b/tests/test_slots_and_tokens.py @@ -2,7 +2,6 @@ PKCS#11 Slots and Tokens """ -import os import unittest import pkcs11 @@ -23,20 +22,6 @@ def test_nonexistent_lib(self): with self.assertRaises(RuntimeError): pkcs11.lib("thislibdoesntexist.so") - @unittest.skipUnless("PKCS11_MODULE2" in os.environ, "Requires an additional PKCS#11 module") - def test_double_initialise_different_libs(self): - lib1 = pkcs11.lib(LIB) - lib2 = pkcs11.lib(os.environ["PKCS11_MODULE2"]) - self.assertIsNotNone(lib1) - self.assertIsNotNone(lib2) - self.assertIsNot(lib1, lib2) - - slots1 = lib1.get_slots() - slots2 = lib2.get_slots() - - self.assertGreaterEqual(len(slots1), 1) - self.assertGreaterEqual(len(slots2), 1) - def test_double_initialise_nonexistent_lib(self): self.assertIsNotNone(pkcs11.lib(LIB)) with self.assertRaises(RuntimeError): diff --git a/uv.lock b/uv.lock index a4bf1ed..9ce7ddb 100644 --- a/uv.lock +++ b/uv.lock @@ -211,6 +211,85 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, ] +[[package]] +name = "coverage" +version = "7.9.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e7/e0/98670a80884f64578f0c22cd70c5e81a6e07b08167721c7487b4d70a7ca0/coverage-7.9.1.tar.gz", hash = "sha256:6cf43c78c4282708a28e466316935ec7489a9c487518a77fa68f716c67909cec", size = 813650, upload-time = "2025-06-13T13:02:28.627Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c1/78/1c1c5ec58f16817c09cbacb39783c3655d54a221b6552f47ff5ac9297603/coverage-7.9.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:cc94d7c5e8423920787c33d811c0be67b7be83c705f001f7180c7b186dcf10ca", size = 212028, upload-time = "2025-06-13T13:00:29.293Z" }, + { url = "https://files.pythonhosted.org/packages/98/db/e91b9076f3a888e3b4ad7972ea3842297a52cc52e73fd1e529856e473510/coverage-7.9.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:16aa0830d0c08a2c40c264cef801db8bc4fc0e1892782e45bcacbd5889270509", size = 212420, upload-time = "2025-06-13T13:00:34.027Z" }, + { url = "https://files.pythonhosted.org/packages/0e/d0/2b3733412954576b0aea0a16c3b6b8fbe95eb975d8bfa10b07359ead4252/coverage-7.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf95981b126f23db63e9dbe4cf65bd71f9a6305696fa5e2262693bc4e2183f5b", size = 241529, upload-time = "2025-06-13T13:00:35.786Z" }, + { url = "https://files.pythonhosted.org/packages/b3/00/5e2e5ae2e750a872226a68e984d4d3f3563cb01d1afb449a17aa819bc2c4/coverage-7.9.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f05031cf21699785cd47cb7485f67df619e7bcdae38e0fde40d23d3d0210d3c3", size = 239403, upload-time = "2025-06-13T13:00:37.399Z" }, + { url = "https://files.pythonhosted.org/packages/37/3b/a2c27736035156b0a7c20683afe7df498480c0dfdf503b8c878a21b6d7fb/coverage-7.9.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb4fbcab8764dc072cb651a4bcda4d11fb5658a1d8d68842a862a6610bd8cfa3", size = 240548, upload-time = "2025-06-13T13:00:39.647Z" }, + { url = "https://files.pythonhosted.org/packages/98/f5/13d5fc074c3c0e0dc80422d9535814abf190f1254d7c3451590dc4f8b18c/coverage-7.9.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:0f16649a7330ec307942ed27d06ee7e7a38417144620bb3d6e9a18ded8a2d3e5", size = 240459, upload-time = "2025-06-13T13:00:40.934Z" }, + { url = "https://files.pythonhosted.org/packages/36/24/24b9676ea06102df824c4a56ffd13dc9da7904478db519efa877d16527d5/coverage-7.9.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:cea0a27a89e6432705fffc178064503508e3c0184b4f061700e771a09de58187", size = 239128, upload-time = "2025-06-13T13:00:42.343Z" }, + { url = "https://files.pythonhosted.org/packages/be/05/242b7a7d491b369ac5fee7908a6e5ba42b3030450f3ad62c645b40c23e0e/coverage-7.9.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e980b53a959fa53b6f05343afbd1e6f44a23ed6c23c4b4c56c6662bbb40c82ce", size = 239402, upload-time = "2025-06-13T13:00:43.634Z" }, + { url = "https://files.pythonhosted.org/packages/73/e0/4de7f87192fa65c9c8fbaeb75507e124f82396b71de1797da5602898be32/coverage-7.9.1-cp310-cp310-win32.whl", hash = "sha256:70760b4c5560be6ca70d11f8988ee6542b003f982b32f83d5ac0b72476607b70", size = 214518, upload-time = "2025-06-13T13:00:45.622Z" }, + { url = "https://files.pythonhosted.org/packages/d5/ab/5e4e2fe458907d2a65fab62c773671cfc5ac704f1e7a9ddd91996f66e3c2/coverage-7.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:a66e8f628b71f78c0e0342003d53b53101ba4e00ea8dabb799d9dba0abbbcebe", size = 215436, upload-time = "2025-06-13T13:00:47.245Z" }, + { url = "https://files.pythonhosted.org/packages/60/34/fa69372a07d0903a78ac103422ad34db72281c9fc625eba94ac1185da66f/coverage-7.9.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:95c765060e65c692da2d2f51a9499c5e9f5cf5453aeaf1420e3fc847cc060582", size = 212146, upload-time = "2025-06-13T13:00:48.496Z" }, + { url = "https://files.pythonhosted.org/packages/27/f0/da1894915d2767f093f081c42afeba18e760f12fdd7a2f4acbe00564d767/coverage-7.9.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ba383dc6afd5ec5b7a0d0c23d38895db0e15bcba7fb0fa8901f245267ac30d86", size = 212536, upload-time = "2025-06-13T13:00:51.535Z" }, + { url = "https://files.pythonhosted.org/packages/10/d5/3fc33b06e41e390f88eef111226a24e4504d216ab8e5d1a7089aa5a3c87a/coverage-7.9.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37ae0383f13cbdcf1e5e7014489b0d71cc0106458878ccde52e8a12ced4298ed", size = 245092, upload-time = "2025-06-13T13:00:52.883Z" }, + { url = "https://files.pythonhosted.org/packages/0a/39/7aa901c14977aba637b78e95800edf77f29f5a380d29768c5b66f258305b/coverage-7.9.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:69aa417a030bf11ec46149636314c24c8d60fadb12fc0ee8f10fda0d918c879d", size = 242806, upload-time = "2025-06-13T13:00:54.571Z" }, + { url = "https://files.pythonhosted.org/packages/43/fc/30e5cfeaf560b1fc1989227adedc11019ce4bb7cce59d65db34fe0c2d963/coverage-7.9.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0a4be2a28656afe279b34d4f91c3e26eccf2f85500d4a4ff0b1f8b54bf807338", size = 244610, upload-time = "2025-06-13T13:00:56.932Z" }, + { url = "https://files.pythonhosted.org/packages/bf/15/cca62b13f39650bc87b2b92bb03bce7f0e79dd0bf2c7529e9fc7393e4d60/coverage-7.9.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:382e7ddd5289f140259b610e5f5c58f713d025cb2f66d0eb17e68d0a94278875", size = 244257, upload-time = "2025-06-13T13:00:58.545Z" }, + { url = "https://files.pythonhosted.org/packages/cd/1a/c0f2abe92c29e1464dbd0ff9d56cb6c88ae2b9e21becdb38bea31fcb2f6c/coverage-7.9.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e5532482344186c543c37bfad0ee6069e8ae4fc38d073b8bc836fc8f03c9e250", size = 242309, upload-time = "2025-06-13T13:00:59.836Z" }, + { url = "https://files.pythonhosted.org/packages/57/8d/c6fd70848bd9bf88fa90df2af5636589a8126d2170f3aade21ed53f2b67a/coverage-7.9.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a39d18b3f50cc121d0ce3838d32d58bd1d15dab89c910358ebefc3665712256c", size = 242898, upload-time = "2025-06-13T13:01:02.506Z" }, + { url = "https://files.pythonhosted.org/packages/c2/9e/6ca46c7bff4675f09a66fe2797cd1ad6a24f14c9c7c3b3ebe0470a6e30b8/coverage-7.9.1-cp311-cp311-win32.whl", hash = "sha256:dd24bd8d77c98557880def750782df77ab2b6885a18483dc8588792247174b32", size = 214561, upload-time = "2025-06-13T13:01:04.012Z" }, + { url = "https://files.pythonhosted.org/packages/a1/30/166978c6302010742dabcdc425fa0f938fa5a800908e39aff37a7a876a13/coverage-7.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:6b55ad10a35a21b8015eabddc9ba31eb590f54adc9cd39bcf09ff5349fd52125", size = 215493, upload-time = "2025-06-13T13:01:05.702Z" }, + { url = "https://files.pythonhosted.org/packages/60/07/a6d2342cd80a5be9f0eeab115bc5ebb3917b4a64c2953534273cf9bc7ae6/coverage-7.9.1-cp311-cp311-win_arm64.whl", hash = "sha256:6ad935f0016be24c0e97fc8c40c465f9c4b85cbbe6eac48934c0dc4d2568321e", size = 213869, upload-time = "2025-06-13T13:01:09.345Z" }, + { url = "https://files.pythonhosted.org/packages/68/d9/7f66eb0a8f2fce222de7bdc2046ec41cb31fe33fb55a330037833fb88afc/coverage-7.9.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a8de12b4b87c20de895f10567639c0797b621b22897b0af3ce4b4e204a743626", size = 212336, upload-time = "2025-06-13T13:01:10.909Z" }, + { url = "https://files.pythonhosted.org/packages/20/20/e07cb920ef3addf20f052ee3d54906e57407b6aeee3227a9c91eea38a665/coverage-7.9.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5add197315a054e92cee1b5f686a2bcba60c4c3e66ee3de77ace6c867bdee7cb", size = 212571, upload-time = "2025-06-13T13:01:12.518Z" }, + { url = "https://files.pythonhosted.org/packages/78/f8/96f155de7e9e248ca9c8ff1a40a521d944ba48bec65352da9be2463745bf/coverage-7.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:600a1d4106fe66f41e5d0136dfbc68fe7200a5cbe85610ddf094f8f22e1b0300", size = 246377, upload-time = "2025-06-13T13:01:14.87Z" }, + { url = "https://files.pythonhosted.org/packages/3e/cf/1d783bd05b7bca5c10ded5f946068909372e94615a4416afadfe3f63492d/coverage-7.9.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a876e4c3e5a2a1715a6608906aa5a2e0475b9c0f68343c2ada98110512ab1d8", size = 243394, upload-time = "2025-06-13T13:01:16.23Z" }, + { url = "https://files.pythonhosted.org/packages/02/dd/e7b20afd35b0a1abea09fb3998e1abc9f9bd953bee548f235aebd2b11401/coverage-7.9.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:81f34346dd63010453922c8e628a52ea2d2ccd73cb2487f7700ac531b247c8a5", size = 245586, upload-time = "2025-06-13T13:01:17.532Z" }, + { url = "https://files.pythonhosted.org/packages/4e/38/b30b0006fea9d617d1cb8e43b1bc9a96af11eff42b87eb8c716cf4d37469/coverage-7.9.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:888f8eee13f2377ce86d44f338968eedec3291876b0b8a7289247ba52cb984cd", size = 245396, upload-time = "2025-06-13T13:01:19.164Z" }, + { url = "https://files.pythonhosted.org/packages/31/e4/4d8ec1dc826e16791f3daf1b50943e8e7e1eb70e8efa7abb03936ff48418/coverage-7.9.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:9969ef1e69b8c8e1e70d591f91bbc37fc9a3621e447525d1602801a24ceda898", size = 243577, upload-time = "2025-06-13T13:01:22.433Z" }, + { url = "https://files.pythonhosted.org/packages/25/f4/b0e96c5c38e6e40ef465c4bc7f138863e2909c00e54a331da335faf0d81a/coverage-7.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:60c458224331ee3f1a5b472773e4a085cc27a86a0b48205409d364272d67140d", size = 244809, upload-time = "2025-06-13T13:01:24.143Z" }, + { url = "https://files.pythonhosted.org/packages/8a/65/27e0a1fa5e2e5079bdca4521be2f5dabf516f94e29a0defed35ac2382eb2/coverage-7.9.1-cp312-cp312-win32.whl", hash = "sha256:5f646a99a8c2b3ff4c6a6e081f78fad0dde275cd59f8f49dc4eab2e394332e74", size = 214724, upload-time = "2025-06-13T13:01:25.435Z" }, + { url = "https://files.pythonhosted.org/packages/9b/a8/d5b128633fd1a5e0401a4160d02fa15986209a9e47717174f99dc2f7166d/coverage-7.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:30f445f85c353090b83e552dcbbdad3ec84c7967e108c3ae54556ca69955563e", size = 215535, upload-time = "2025-06-13T13:01:27.861Z" }, + { url = "https://files.pythonhosted.org/packages/a3/37/84bba9d2afabc3611f3e4325ee2c6a47cd449b580d4a606b240ce5a6f9bf/coverage-7.9.1-cp312-cp312-win_arm64.whl", hash = "sha256:af41da5dca398d3474129c58cb2b106a5d93bbb196be0d307ac82311ca234342", size = 213904, upload-time = "2025-06-13T13:01:29.202Z" }, + { url = "https://files.pythonhosted.org/packages/d0/a7/a027970c991ca90f24e968999f7d509332daf6b8c3533d68633930aaebac/coverage-7.9.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:31324f18d5969feef7344a932c32428a2d1a3e50b15a6404e97cba1cc9b2c631", size = 212358, upload-time = "2025-06-13T13:01:30.909Z" }, + { url = "https://files.pythonhosted.org/packages/f2/48/6aaed3651ae83b231556750280682528fea8ac7f1232834573472d83e459/coverage-7.9.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0c804506d624e8a20fb3108764c52e0eef664e29d21692afa375e0dd98dc384f", size = 212620, upload-time = "2025-06-13T13:01:32.256Z" }, + { url = "https://files.pythonhosted.org/packages/6c/2a/f4b613f3b44d8b9f144847c89151992b2b6b79cbc506dee89ad0c35f209d/coverage-7.9.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef64c27bc40189f36fcc50c3fb8f16ccda73b6a0b80d9bd6e6ce4cffcd810bbd", size = 245788, upload-time = "2025-06-13T13:01:33.948Z" }, + { url = "https://files.pythonhosted.org/packages/04/d2/de4fdc03af5e4e035ef420ed26a703c6ad3d7a07aff2e959eb84e3b19ca8/coverage-7.9.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4fe2348cc6ec372e25adec0219ee2334a68d2f5222e0cba9c0d613394e12d86", size = 243001, upload-time = "2025-06-13T13:01:35.285Z" }, + { url = "https://files.pythonhosted.org/packages/f5/e8/eed18aa5583b0423ab7f04e34659e51101135c41cd1dcb33ac1d7013a6d6/coverage-7.9.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:34ed2186fe52fcc24d4561041979a0dec69adae7bce2ae8d1c49eace13e55c43", size = 244985, upload-time = "2025-06-13T13:01:36.712Z" }, + { url = "https://files.pythonhosted.org/packages/17/f8/ae9e5cce8885728c934eaa58ebfa8281d488ef2afa81c3dbc8ee9e6d80db/coverage-7.9.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:25308bd3d00d5eedd5ae7d4357161f4df743e3c0240fa773ee1b0f75e6c7c0f1", size = 245152, upload-time = "2025-06-13T13:01:39.303Z" }, + { url = "https://files.pythonhosted.org/packages/5a/c8/272c01ae792bb3af9b30fac14d71d63371db227980682836ec388e2c57c0/coverage-7.9.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:73e9439310f65d55a5a1e0564b48e34f5369bee943d72c88378f2d576f5a5751", size = 243123, upload-time = "2025-06-13T13:01:40.727Z" }, + { url = "https://files.pythonhosted.org/packages/8c/d0/2819a1e3086143c094ab446e3bdf07138527a7b88cb235c488e78150ba7a/coverage-7.9.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:37ab6be0859141b53aa89412a82454b482c81cf750de4f29223d52268a86de67", size = 244506, upload-time = "2025-06-13T13:01:42.184Z" }, + { url = "https://files.pythonhosted.org/packages/8b/4e/9f6117b89152df7b6112f65c7a4ed1f2f5ec8e60c4be8f351d91e7acc848/coverage-7.9.1-cp313-cp313-win32.whl", hash = "sha256:64bdd969456e2d02a8b08aa047a92d269c7ac1f47e0c977675d550c9a0863643", size = 214766, upload-time = "2025-06-13T13:01:44.482Z" }, + { url = "https://files.pythonhosted.org/packages/27/0f/4b59f7c93b52c2c4ce7387c5a4e135e49891bb3b7408dcc98fe44033bbe0/coverage-7.9.1-cp313-cp313-win_amd64.whl", hash = "sha256:be9e3f68ca9edb897c2184ad0eee815c635565dbe7a0e7e814dc1f7cbab92c0a", size = 215568, upload-time = "2025-06-13T13:01:45.772Z" }, + { url = "https://files.pythonhosted.org/packages/09/1e/9679826336f8c67b9c39a359352882b24a8a7aee48d4c9cad08d38d7510f/coverage-7.9.1-cp313-cp313-win_arm64.whl", hash = "sha256:1c503289ffef1d5105d91bbb4d62cbe4b14bec4d13ca225f9c73cde9bb46207d", size = 213939, upload-time = "2025-06-13T13:01:47.087Z" }, + { url = "https://files.pythonhosted.org/packages/bb/5b/5c6b4e7a407359a2e3b27bf9c8a7b658127975def62077d441b93a30dbe8/coverage-7.9.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0b3496922cb5f4215bf5caaef4cf12364a26b0be82e9ed6d050f3352cf2d7ef0", size = 213079, upload-time = "2025-06-13T13:01:48.554Z" }, + { url = "https://files.pythonhosted.org/packages/a2/22/1e2e07279fd2fd97ae26c01cc2186e2258850e9ec125ae87184225662e89/coverage-7.9.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:9565c3ab1c93310569ec0d86b017f128f027cab0b622b7af288696d7ed43a16d", size = 213299, upload-time = "2025-06-13T13:01:49.997Z" }, + { url = "https://files.pythonhosted.org/packages/14/c0/4c5125a4b69d66b8c85986d3321520f628756cf524af810baab0790c7647/coverage-7.9.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2241ad5dbf79ae1d9c08fe52b36d03ca122fb9ac6bca0f34439e99f8327ac89f", size = 256535, upload-time = "2025-06-13T13:01:51.314Z" }, + { url = "https://files.pythonhosted.org/packages/81/8b/e36a04889dda9960be4263e95e777e7b46f1bb4fc32202612c130a20c4da/coverage-7.9.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3bb5838701ca68b10ebc0937dbd0eb81974bac54447c55cd58dea5bca8451029", size = 252756, upload-time = "2025-06-13T13:01:54.403Z" }, + { url = "https://files.pythonhosted.org/packages/98/82/be04eff8083a09a4622ecd0e1f31a2c563dbea3ed848069e7b0445043a70/coverage-7.9.1-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b30a25f814591a8c0c5372c11ac8967f669b97444c47fd794926e175c4047ece", size = 254912, upload-time = "2025-06-13T13:01:56.769Z" }, + { url = "https://files.pythonhosted.org/packages/0f/25/c26610a2c7f018508a5ab958e5b3202d900422cf7cdca7670b6b8ca4e8df/coverage-7.9.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:2d04b16a6062516df97969f1ae7efd0de9c31eb6ebdceaa0d213b21c0ca1a683", size = 256144, upload-time = "2025-06-13T13:01:58.19Z" }, + { url = "https://files.pythonhosted.org/packages/c5/8b/fb9425c4684066c79e863f1e6e7ecebb49e3a64d9f7f7860ef1688c56f4a/coverage-7.9.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:7931b9e249edefb07cd6ae10c702788546341d5fe44db5b6108a25da4dca513f", size = 254257, upload-time = "2025-06-13T13:01:59.645Z" }, + { url = "https://files.pythonhosted.org/packages/93/df/27b882f54157fc1131e0e215b0da3b8d608d9b8ef79a045280118a8f98fe/coverage-7.9.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:52e92b01041151bf607ee858e5a56c62d4b70f4dac85b8c8cb7fb8a351ab2c10", size = 255094, upload-time = "2025-06-13T13:02:01.37Z" }, + { url = "https://files.pythonhosted.org/packages/41/5f/cad1c3dbed8b3ee9e16fa832afe365b4e3eeab1fb6edb65ebbf745eabc92/coverage-7.9.1-cp313-cp313t-win32.whl", hash = "sha256:684e2110ed84fd1ca5f40e89aa44adf1729dc85444004111aa01866507adf363", size = 215437, upload-time = "2025-06-13T13:02:02.905Z" }, + { url = "https://files.pythonhosted.org/packages/99/4d/fad293bf081c0e43331ca745ff63673badc20afea2104b431cdd8c278b4c/coverage-7.9.1-cp313-cp313t-win_amd64.whl", hash = "sha256:437c576979e4db840539674e68c84b3cda82bc824dd138d56bead1435f1cb5d7", size = 216605, upload-time = "2025-06-13T13:02:05.638Z" }, + { url = "https://files.pythonhosted.org/packages/1f/56/4ee027d5965fc7fc126d7ec1187529cc30cc7d740846e1ecb5e92d31b224/coverage-7.9.1-cp313-cp313t-win_arm64.whl", hash = "sha256:18a0912944d70aaf5f399e350445738a1a20b50fbea788f640751c2ed9208b6c", size = 214392, upload-time = "2025-06-13T13:02:07.642Z" }, + { url = "https://files.pythonhosted.org/packages/a5/d6/c41dd9b02bf16ec001aaf1cbef665537606899a3db1094e78f5ae17540ca/coverage-7.9.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6f424507f57878e424d9a95dc4ead3fbdd72fd201e404e861e465f28ea469951", size = 212029, upload-time = "2025-06-13T13:02:09.058Z" }, + { url = "https://files.pythonhosted.org/packages/f8/c0/40420d81d731f84c3916dcdf0506b3e6c6570817bff2576b83f780914ae6/coverage-7.9.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:535fde4001b2783ac80865d90e7cc7798b6b126f4cd8a8c54acfe76804e54e58", size = 212407, upload-time = "2025-06-13T13:02:11.151Z" }, + { url = "https://files.pythonhosted.org/packages/9b/87/f0db7d62d0e09f14d6d2f6ae8c7274a2f09edf74895a34b412a0601e375a/coverage-7.9.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02532fd3290bb8fa6bec876520842428e2a6ed6c27014eca81b031c2d30e3f71", size = 241160, upload-time = "2025-06-13T13:02:12.864Z" }, + { url = "https://files.pythonhosted.org/packages/a9/b7/3337c064f058a5d7696c4867159651a5b5fb01a5202bcf37362f0c51400e/coverage-7.9.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56f5eb308b17bca3bbff810f55ee26d51926d9f89ba92707ee41d3c061257e55", size = 239027, upload-time = "2025-06-13T13:02:14.294Z" }, + { url = "https://files.pythonhosted.org/packages/7e/a9/5898a283f66d1bd413c32c2e0e05408196fd4f37e206e2b06c6e0c626e0e/coverage-7.9.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfa447506c1a52271f1b0de3f42ea0fa14676052549095e378d5bff1c505ff7b", size = 240145, upload-time = "2025-06-13T13:02:15.745Z" }, + { url = "https://files.pythonhosted.org/packages/e0/33/d96e3350078a3c423c549cb5b2ba970de24c5257954d3e4066e2b2152d30/coverage-7.9.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:9ca8e220006966b4a7b68e8984a6aee645a0384b0769e829ba60281fe61ec4f7", size = 239871, upload-time = "2025-06-13T13:02:17.344Z" }, + { url = "https://files.pythonhosted.org/packages/1d/6e/6fb946072455f71a820cac144d49d11747a0f1a21038060a68d2d0200499/coverage-7.9.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:49f1d0788ba5b7ba65933f3a18864117c6506619f5ca80326b478f72acf3f385", size = 238122, upload-time = "2025-06-13T13:02:18.849Z" }, + { url = "https://files.pythonhosted.org/packages/e4/5c/bc43f25c8586840ce25a796a8111acf6a2b5f0909ba89a10d41ccff3920d/coverage-7.9.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:68cd53aec6f45b8e4724c0950ce86eacb775c6be01ce6e3669fe4f3a21e768ed", size = 239058, upload-time = "2025-06-13T13:02:21.423Z" }, + { url = "https://files.pythonhosted.org/packages/11/d8/ce2007418dd7fd00ff8c8b898bb150bb4bac2d6a86df05d7b88a07ff595f/coverage-7.9.1-cp39-cp39-win32.whl", hash = "sha256:95335095b6c7b1cc14c3f3f17d5452ce677e8490d101698562b2ffcacc304c8d", size = 214532, upload-time = "2025-06-13T13:02:22.857Z" }, + { url = "https://files.pythonhosted.org/packages/20/21/334e76fa246e92e6d69cab217f7c8a70ae0cc8f01438bd0544103f29528e/coverage-7.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:e1b5191d1648acc439b24721caab2fd0c86679d8549ed2c84d5a7ec1bedcc244", size = 215439, upload-time = "2025-06-13T13:02:24.268Z" }, + { url = "https://files.pythonhosted.org/packages/3e/e5/c723545c3fd3204ebde3b4cc4b927dce709d3b6dc577754bb57f63ca4a4a/coverage-7.9.1-pp39.pp310.pp311-none-any.whl", hash = "sha256:db0f04118d1db74db6c9e1cb1898532c7dcc220f1d2718f058601f7c3f499514", size = 204009, upload-time = "2025-06-13T13:02:25.787Z" }, + { url = "https://files.pythonhosted.org/packages/08/b8/7ddd1e8ba9701dea08ce22029917140e6f66a859427406579fd8d0ca7274/coverage-7.9.1-py3-none-any.whl", hash = "sha256:66b974b145aa189516b6bf2d8423e888b742517d37872f6ee4c5be0073bd9a3c", size = 204000, upload-time = "2025-06-13T13:02:27.173Z" }, +] + +[package.optional-dependencies] +toml = [ + { name = "tomli", marker = "python_full_version <= '3.11'" }, +] + [[package]] name = "cryptography" version = "45.0.4" @@ -520,6 +599,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/2f/de/afa024cbe022b1b318a3d224125aa24939e99b4ff6f22e0ba639a2eaee47/pytest-8.4.0-py3-none-any.whl", hash = "sha256:f40f825768ad76c0977cbacdf1fd37c6f7a468e460ea6a0636078f8972d4517e", size = 363797, upload-time = "2025-06-02T17:36:27.859Z" }, ] +[[package]] +name = "pytest-cov" +version = "6.2.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "coverage", extra = ["toml"] }, + { name = "pluggy" }, + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/18/99/668cade231f434aaa59bbfbf49469068d2ddd945000621d3d165d2e7dd7b/pytest_cov-6.2.1.tar.gz", hash = "sha256:25cc6cc0a5358204b8108ecedc51a9b57b34cc6b8c967cc2c01a4e00d8a67da2", size = 69432, upload-time = "2025-06-12T10:47:47.684Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bc/16/4ea354101abb1287856baa4af2732be351c7bee728065aed451b678153fd/pytest_cov-6.2.1-py3-none-any.whl", hash = "sha256:f5bc4c23f42f1cdd23c70b1dab1bbaef4fc505ba950d53e0081d0730dd7e86d5", size = 24644, upload-time = "2025-06-12T10:47:45.932Z" }, +] + [[package]] name = "python-pkcs11" source = { editable = "." } @@ -528,6 +621,14 @@ dependencies = [ ] [package.dev-dependencies] +coverage = [ + { name = "coverage" }, + { name = "cryptography" }, + { name = "cython" }, + { name = "parameterized" }, + { name = "pytest" }, + { name = "pytest-cov" }, +] dev = [ { name = "cryptography" }, { name = "cython" }, @@ -572,6 +673,14 @@ testing = [ requires-dist = [{ name = "asn1crypto", specifier = ">=1.5.1" }] [package.metadata.requires-dev] +coverage = [ + { name = "coverage", specifier = ">=7.9.1" }, + { name = "cryptography", specifier = ">=44.0.0" }, + { name = "cython" }, + { name = "parameterized", specifier = ">=0.9.0" }, + { name = "pytest", specifier = ">=8.3.4" }, + { name = "pytest-cov", specifier = ">=4.0,<6.3" }, +] dev = [ { name = "cryptography", specifier = ">=44.0.0" }, { name = "cython" },