c2pa-python 0.12.1__tar.gz → 0.13.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {c2pa_python-0.12.1/src/c2pa_python.egg-info → c2pa_python-0.13.0}/PKG-INFO +2 -1
  2. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/README.md +1 -0
  3. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/pyproject.toml +1 -1
  4. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/setup.py +5 -17
  5. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/src/c2pa/__init__.py +1 -1
  6. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/src/c2pa/build.py +8 -5
  7. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/src/c2pa/c2pa.py +577 -311
  8. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/src/c2pa/lib.py +43 -44
  9. {c2pa_python-0.12.1 → c2pa_python-0.13.0/src/c2pa_python.egg-info}/PKG-INFO +2 -1
  10. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/tests/test_unit_tests.py +1286 -453
  11. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/tests/test_unit_tests_threaded.py +6 -331
  12. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/LICENSE-APACHE +0 -0
  13. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/LICENSE-MIT +0 -0
  14. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/MANIFEST.in +0 -0
  15. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/requirements.txt +0 -0
  16. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/scripts/download_artifacts.py +0 -0
  17. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/setup.cfg +0 -0
  18. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/src/c2pa_python.egg-info/SOURCES.txt +0 -0
  19. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/src/c2pa_python.egg-info/dependency_links.txt +0 -0
  20. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/src/c2pa_python.egg-info/entry_points.txt +0 -0
  21. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/src/c2pa_python.egg-info/requires.txt +0 -0
  22. {c2pa_python-0.12.1 → c2pa_python-0.13.0}/src/c2pa_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: c2pa-python
3
- Version: 0.12.1
3
+ Version: 0.13.0
4
4
  Summary: Python bindings for the C2PA Content Authenticity Initiative (CAI) library
5
5
  Author-email: Gavin Peacock <gvnpeacock@adobe.com>, Tania Mathern <mathern@adobe.com>
6
6
  Maintainer-email: Gavin Peacock <gpeacock@adobe.com>
@@ -24,6 +24,7 @@ Dynamic: requires-python
24
24
  # C2PA Python library
25
25
 
26
26
  The [c2pa-python](https://github.com/contentauth/c2pa-python) repository provides a Python library that can:
27
+
27
28
  - Read and validate C2PA manifest data from media files in supported formats.
28
29
  - Create and sign manifest data, and attach it to media files in supported formats.
29
30
 
@@ -1,6 +1,7 @@
1
1
  # C2PA Python library
2
2
 
3
3
  The [c2pa-python](https://github.com/contentauth/c2pa-python) repository provides a Python library that can:
4
+
4
5
  - Read and validate C2PA manifest data from media files in supported formats.
5
6
  - Create and sign manifest data, and attach it to media files in supported formats.
6
7
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "c2pa-python"
7
- version = "0.12.1"
7
+ version = "0.13.0"
8
8
  requires-python = ">=3.10"
9
9
  description = "Python bindings for the C2PA Content Authenticity Initiative (CAI) library"
10
10
  readme = { file = "README.md", content-type = "text/markdown" }
@@ -17,8 +17,7 @@ PACKAGE_NAME = "c2pa-python" # Define package name as a constant
17
17
  PLATFORM_EXTENSIONS = {
18
18
  'win_amd64': 'dll',
19
19
  'win_arm64': 'dll',
20
- 'macosx_x86_64': 'dylib',
21
- 'apple-darwin': 'dylib', # we need to update the published keys
20
+ 'apple-darwin': 'dylib', # universal
22
21
  'linux_x86_64': 'so',
23
22
  'linux_aarch64': 'so',
24
23
  }
@@ -26,11 +25,9 @@ PLATFORM_EXTENSIONS = {
26
25
  # Based on what c2pa-rs repo publishes
27
26
  PLATFORM_FOLDERS = {
28
27
  'universal-apple-darwin': 'dylib',
29
- 'aarch64-apple-darwin': 'dylib',
30
- 'x86_64-apple-darwin': 'dylib',
31
28
  'x86_64-pc-windows-msvc': 'dll',
32
29
  'x86_64-unknown-linux-gnu': 'so',
33
- 'aarch64-unknown-linux-gnu': 'so', # Add ARM Linux support
30
+ 'aarch64-unknown-linux-gnu': 'so',
34
31
  }
35
32
 
36
33
  # Directory structure
@@ -38,7 +35,7 @@ ARTIFACTS_DIR = Path('artifacts') # Where downloaded libraries are stored
38
35
  PACKAGE_LIBS_DIR = Path('src/c2pa/libs') # Where libraries will be copied for the wheel
39
36
 
40
37
 
41
- def get_platform_identifier(cpu_arch = None) -> str:
38
+ def get_platform_identifier() -> str:
42
39
  """Get a platform identifier (arch-os) for the current system,
43
40
  matching downloaded identifiers used by the Github publisher.
44
41
 
@@ -47,9 +44,7 @@ def get_platform_identifier(cpu_arch = None) -> str:
47
44
  cpu_arch: Optional CPU architecture for macOS. If not provided, returns universal build.
48
45
 
49
46
  Returns one of:
50
- - universal-apple-darwin (for Mac, when cpu_arch is None, fallback)
51
- - aarch64-apple-darwin (for Mac ARM64)
52
- - x86_64-apple-darwin (for Mac x86_64)
47
+ - universal-apple-darwin (for macOS)
53
48
  - x86_64-pc-windows-msvc (for Windows 64-bit)
54
49
  - x86_64-unknown-linux-gnu (for Linux 64-bit)
55
50
  - aarch64-unknown-linux-gnu (for Linux ARM64)
@@ -57,14 +52,7 @@ def get_platform_identifier(cpu_arch = None) -> str:
57
52
  system = platform.system().lower()
58
53
 
59
54
  if system == "darwin":
60
- if cpu_arch is None:
61
- return "universal-apple-darwin"
62
- elif cpu_arch == "arm64":
63
- return "aarch64-apple-darwin"
64
- elif cpu_arch == "x86_64":
65
- return "x86_64-apple-darwin"
66
- else:
67
- raise ValueError(f"Unsupported CPU architecture for macOS: {cpu_arch}")
55
+ return "universal-apple-darwin"
68
56
  elif system == "windows":
69
57
  return "x86_64-pc-windows-msvc"
70
58
  elif system == "linux":
@@ -1,7 +1,7 @@
1
1
  try:
2
2
  from importlib.metadata import version
3
3
  __version__ = version("c2pa-python")
4
- except ImportError:
4
+ except ImportError: # pragma: no cover
5
5
  __version__ = "unknown"
6
6
 
7
7
  from .c2pa import (
@@ -1,11 +1,9 @@
1
1
  import os
2
2
  import sys
3
- import json
4
3
  import requests
5
4
  from pathlib import Path
6
5
  import zipfile
7
6
  import io
8
- from typing import Optional
9
7
 
10
8
  # Constants
11
9
  REPO_OWNER = "contentauth"
@@ -23,7 +21,10 @@ def get_latest_release() -> dict:
23
21
 
24
22
 
25
23
  def download_artifact(url: str, platform_name: str) -> None:
26
- """Download and extract an artifact to the appropriate platform directory."""
24
+ """
25
+ Download and extract an artifact
26
+ to the appropriate platform directory.
27
+ """
27
28
  print(f"Downloading artifact for {platform_name}...")
28
29
 
29
30
  # Create platform directory
@@ -44,7 +45,8 @@ def download_artifact(url: str, platform_name: str) -> None:
44
45
 
45
46
 
46
47
  def download_artifacts() -> None:
47
- """Main function to download artifacts. Can be called as a script or from hatch."""
48
+ """Main function to download artifacts.
49
+ Can be called as a script or from hatch."""
48
50
  try:
49
51
  # Create artifacts directory if it doesn't exist
50
52
  ARTIFACTS_DIR.mkdir(exist_ok=True)
@@ -78,7 +80,8 @@ def download_artifacts() -> None:
78
80
 
79
81
 
80
82
  def inject_version():
81
- """Inject the version from pyproject.toml into src/c2pa/__init__.py as __version__."""
83
+ """Inject the version from pyproject.toml
84
+ into src/c2pa/__init__.py as __version__."""
82
85
  import toml
83
86
  pyproject_path = os.path.abspath(
84
87
  os.path.join(