Skip to content

feat: Add Python goodies#65

Merged
tmathern merged 26 commits into
gpeacock/pythonfrom
mathern/idiomatic-python
May 9, 2025
Merged

feat: Add Python goodies#65
tmathern merged 26 commits into
gpeacock/pythonfrom
mathern/idiomatic-python

Conversation

@tmathern
Copy link
Copy Markdown
Collaborator

@tmathern tmathern commented May 9, 2025

  • Make Stream class usable with context manager (with keyword)
  • When loading the bound native lib, check needed functions are here to avoid bad surprises
  • Streamline error handling
  • Rewrite one test file to use unittest instead of pytest (pytest command still can run the tests) to have only one framework used
  • Found a bug where c2pa_builder_add_ingredient instead of c2pa_builder_add_ingredient_from_stream was called, fixed it (The symbol is not in the current lib)
  • Make resources cleaning for Reader, Builder, Signer and Stream more robust (esp. avoid double free)
  • Probably some other minor things I forgot while working on the above!

Also tested these changes with other implementations we're working on and tests passed there too

@tmathern tmathern requested a review from gpeacock May 9, 2025 15:42
@tmathern tmathern self-assigned this May 9, 2025
Comment thread tests/test_c2pa.py
Comment thread tests/test_unit_tests.py
Comment thread tests/c2pa.py
Comment thread tests/c2pa.py
Copy link
Copy Markdown
Member

@gpeacock gpeacock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

Comment thread tests/c2pa.py
Comment thread tests/c2pa.py
Comment thread tests/c2pa.py Outdated
Comment thread tests/test_c2pa.py Outdated
Comment thread tests/c2pa.py
Comment thread tests/c2pa.py Outdated
@tmathern tmathern merged commit 10c0e0a into gpeacock/python May 9, 2025
9 of 19 checks passed
@tmathern tmathern deleted the mathern/idiomatic-python branch May 9, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants