Skip to content

Add pytest test suite and replace pylint with ruff#24

Merged
hyperfinitism merged 4 commits intomainfrom
ci/add-pytest-and-ruff
Mar 5, 2026
Merged

Add pytest test suite and replace pylint with ruff#24
hyperfinitism merged 4 commits intomainfrom
ci/add-pytest-and-ruff

Conversation

@hyperfinitism
Copy link
Collaborator

Summary

Add a comprehensive test suite and modernize the CI linting/formatting pipeline.

Tests (tests/)

  • Add 116 tests covering the library and example CLIs:
    • test_types.pypysnputils.types (helper functions, enums, bitfield types, AttestationReport parsing)
    • test_fetch.pypysnputils.fetch (KDS URL generation, fetch functions with mocked HTTP)
    • test_verify.pypysnputils.verify (certificate chain validation, report signature verification with real ECDSA-P384 signing)
    • test_examples.pyexamples/*.py CLI scripts (argument parsing, output format, mocked I/O)
  • Add conftest.py with shared fixtures and helpers (synthetic report builder, certificate generators)
  • Add .github/workflows/pytest.yml CI workflow (Python 3.11 / 3.12)

Linter / Formatter: pylint → ruff

  • Remove .pylintrc and .github/workflows/pylint.yml
  • Add [tool.ruff] configuration in pyproject.toml
    • Rule sets: E, W, F, I, UP, B, SIM, PL
    • Migrated pylint ignore rules (too-many-arguments, too-many-locals, etc.)
  • Add .github/workflows/ruff.yml (ruff check + ruff format --check)
  • Fix all lint/format errors across existing source files

Other

  • Lower minimum supported Python version from 3.12 to 3.11 (requires-python, pytest matrix)
  • Replace pylint with ruff in [project.optional-dependencies]

Tests

  • local ruff check . — all checks passed
  • local ruff format --check . — all 13 files formatted
  • pytest tests -v — 116/116 passed
  • Confirm CI workflows pass on GitHub (pytest, ruff, spdx)

@hyperfinitism hyperfinitism self-assigned this Mar 5, 2026
@hyperfinitism hyperfinitism added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 5, 2026
@hyperfinitism hyperfinitism force-pushed the ci/add-pytest-and-ruff branch from 9b6d8a7 to 398d7bc Compare March 5, 2026 09:35
@hyperfinitism hyperfinitism merged commit 9bd8439 into main Mar 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant