Skip to content

fix(deps): make cryptography an optional test dependency - #323

Open
AlexanderKomarov wants to merge 1 commit into
contentauth:mainfrom
AlexanderKomarov:fix/cryptography-optional-test-dep
Open

fix(deps): make cryptography an optional test dependency#323
AlexanderKomarov wants to merge 1 commit into
contentauth:mainfrom
AlexanderKomarov:fix/cryptography-optional-test-dep

Conversation

@AlexanderKomarov

Copy link
Copy Markdown

Changes in this pull request

cryptography is declared as a runtime dependency, but it is not used by the
runtime bindings in src/c2pa — all cryptographic operations (hashing, COSE
signing/verification, certificate-chain validation) happen inside the bundled
native c2pa-rs library. It is only imported by the test suite and the examples
to implement Signer.from_callback helpers (ES256 / ECDSA over PEM keys);
requirements.txt even noted it was "only used in the training example".

Declaring it under [project.dependencies] forces every downstream consumer to
install cryptography (~14 MB, bundles its own OpenSSL) with no runtime benefit,
enlarging install size and CVE/compliance surface.

This PR:

  • moves cryptography to a test optional-dependency in pyproject.toml
    (mirroring requirements-dev.txt);
  • drops it from requirements.txt (which already flagged it as example-only);
  • installs the built wheel with the [test] extra in the wheel-test CI jobs so
    the suite still has it.

No runtime behaviour changes.

Verified locally: a wheel built from this branch installs c2pa-python,
toml, requests only (no cryptography), imports fine, and reads a real
signed C2PA asset; pip install "<wheel>[test]" pulls cryptography for the
tests.

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items (or similar) have been entered as GitHub issues — N/A (no TODOs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant