Skip to content

Feature c2pa spec v2.2#4

Merged
olgahaha merged 6 commits intomainfrom
feature-c2pa-spec-v2.2
Nov 18, 2025
Merged

Feature c2pa spec v2.2#4
olgahaha merged 6 commits intomainfrom
feature-c2pa-spec-v2.2

Conversation

@olgahaha
Copy link
Contributor

Upgrade to C2PA spec v2.2 and c2patool v0.26.1

Changes

  • Upgrade manifest generation to C2PA spec v2.2
  • Update c2patool to v0.26.1
  • Bump version to 0.4.0
  • Drop Python 3.7/3.8, add Python 3.11/3.12/3.13 support
  • Upgrade GitHub Actions to latest versions

Breaking Changes:

  • Removed create_custom_c2pa_manifest from public API
  • creator_name is now optional in create_c2pa_manifest
  • Minimum Python version: 3.9

- Update to c2patool v0.26.1 with prebuilt binaries
- Replace stds.schema-org.CreativeWork with c2pa.metadata
- Update ingredient references to c2pa.ingredient.v3
- Add optional claim_generator_version parameter
- Support IPTC and C2PA URI formats for digitalSourceType
- Improve EXIF GPS format (degrees,minutes with direction)
- Remove unused create_custom_c2pa_manifest function

Breaking changes:
- Removed create_custom_c2pa_manifest from public API
- creator_name is now optional in create_c2pa_manifest
- Upgrade actions/checkout from v3 to v5
- Upgrade actions/setup-python from v3 to v6
- Remove Python 3.8 (not available on ubuntu-latest)
- Add Python 3.12 and 3.13 to test matrix
- Update publish workflow to use Python 3.9

Fixes pip cache 400 error caused by outdated actions/setup-python@v3
- Bump version from 0.3.0 to 0.4.0
- Remove Python 3.7 and 3.8 support
- Add Python 3.11, 3.12, and 3.13 support
- Update python_requires from >=3.7 to >=3.9
- Update tox env_list to test py39-py313

Aligns with C2PA spec v2.2 upgrade and ubuntu-latest support
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR successfully upgrades the numbers-c2pa library to support C2PA specification v2.2 and c2patool v0.26.1, modernizing the codebase to support current Python versions (3.9-3.13) while dropping support for Python 3.7 and 3.8.

Key Changes:

  • Refactored metadata assertions from schema.org CreativeWork to native c2pa.metadata format with EXIF/IPTC namespaces
  • Updated geolocation formatting from decimal to DMS (Degrees, Minutes, Seconds) format per EXIF standards
  • Made creator_name optional in manifest creation API and removed the deprecated create_custom_c2pa_manifest function
  • Updated c2patool integration to use c2pa.ingredient.v3 label for compatibility with v0.26.1

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/numbers_c2pa/core.py Core refactoring: converted creative work assertions to c2pa.metadata format, updated geolocation to DMS format, made creator_name optional, removed custom manifest function, updated ingredient references to v3
src/numbers_c2pa/init.py Removed deprecated create_custom_c2pa_manifest from public API exports
setup.cfg Version bump to 0.4.0, updated Python version support (3.9-3.13), modernized tox environment list
README.md Added comprehensive c2patool v0.26.1 installation instructions for macOS, Linux, and Windows platforms
.github/workflows/python-publish.yml Updated GitHub Actions to v5/v6, changed base Python version from 3.8 to 3.9
.github/workflows/build.yml Updated GitHub Actions to v5/v6, expanded test matrix to Python 3.9-3.13

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add coordinate range validation for lat/lon
- Return None for invalid coordinates to skip EXIF fields
- Require both lat and lon to be valid before adding GPS data
- Add isinstance check for date_captured consistency
- Support https:// URIs in digital_source_type
- Improve digital_source_type documentation with examples

Addresses review comments for better input validation and docs
Break line 230 to stay within 120 character limit (E501)
Remove superfluous parentheses in range checks (C0325)
@olgahaha olgahaha merged commit 5f08095 into main Nov 18, 2025
13 checks passed
@olgahaha olgahaha deleted the feature-c2pa-spec-v2.2 branch November 18, 2025 07:42
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.

2 participants