c2pa-python 0.37.10__tar.gz → 0.37.12__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.37.10/src/c2pa_python.egg-info → c2pa_python-0.37.12}/PKG-INFO +1 -1
  2. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/pyproject.toml +1 -1
  3. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/src/c2pa/c2pa.py +1 -1
  4. {c2pa_python-0.37.10 → c2pa_python-0.37.12/src/c2pa_python.egg-info}/PKG-INFO +1 -1
  5. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/tests/test_unit_tests.py +126 -23
  6. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/LICENSE-APACHE +0 -0
  7. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/LICENSE-MIT +0 -0
  8. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/MANIFEST.in +0 -0
  9. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/README.md +0 -0
  10. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/requirements.txt +0 -0
  11. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/scripts/download_artifacts.py +0 -0
  12. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/setup.cfg +0 -0
  13. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/setup.py +0 -0
  14. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/src/c2pa/__init__.py +0 -0
  15. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/src/c2pa/build.py +0 -0
  16. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/src/c2pa/lib.py +0 -0
  17. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/src/c2pa_python.egg-info/SOURCES.txt +0 -0
  18. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/src/c2pa_python.egg-info/dependency_links.txt +0 -0
  19. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/src/c2pa_python.egg-info/entry_points.txt +0 -0
  20. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/src/c2pa_python.egg-info/requires.txt +0 -0
  21. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/src/c2pa_python.egg-info/top_level.txt +0 -0
  22. {c2pa_python-0.37.10 → c2pa_python-0.37.12}/tests/test_unit_tests_threaded.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: c2pa-python
3
- Version: 0.37.10
3
+ Version: 0.37.12
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>, Tania Mathern <mathern@adobe.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "c2pa-python"
7
- version = "0.37.10"
7
+ version = "0.37.12"
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" }
@@ -11,7 +11,7 @@
11
11
  # specific language governing permissions and limitations under
12
12
  # each license.
13
13
 
14
- # Version: 0.37.10
14
+ # Version: 0.37.12
15
15
 
16
16
  import ctypes
17
17
  import enum
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: c2pa-python
3
- Version: 0.37.10
3
+ Version: 0.37.12
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>, Tania Mathern <mathern@adobe.com>
@@ -76,16 +76,27 @@ def load_test_settings_json():
76
76
 
77
77
  def parse_native_version():
78
78
  """
79
- Parse the expected native SDK version from c2pa-native-version.txt.
79
+ Parse the expected native SDK version.
80
+
81
+ Reads c2pa-rs-preflight-ref.txt instead of c2pa-native-version.txt when
82
+ C2PA_PREFLIGHT_RUN is set: that flag is set only by
83
+ test-c2pa-rs-source-build.yml's own "Run tests" step, because the
84
+ presence of c2pa-rs-preflight-ref.txt in the checked-out tree isn't by
85
+ itself proof of anything -- an ordinary build.yml run on a branch that
86
+ happens to carry that file (e.g. this PR) still downloads and installs
87
+ the real pinned release, not the preflight ref.
80
88
 
81
89
  Returns:
82
90
  str: The semantic version string (e.g. "0.85.2").
83
91
  """
84
92
  repo_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
85
- version_path = os.path.join(repo_root, 'c2pa-native-version.txt')
86
- with open(version_path, 'r') as f:
93
+ if os.environ.get('C2PA_PREFLIGHT_RUN'):
94
+ path = os.path.join(repo_root, 'c2pa-rs-preflight-ref.txt')
95
+ else:
96
+ path = os.path.join(repo_root, 'c2pa-native-version.txt')
97
+ with open(path, 'r') as f:
87
98
  raw = f.read().strip()
88
- # Strip the "c2pa-v" prefix to get the bare semantic version.
99
+ # Strip the "c2pa-v" / "c2pa-rc-v" prefix to get the bare semantic version.
89
100
  return raw.split('v', 1)[1] if 'v' in raw else raw
90
101
 
91
102
 
@@ -2629,7 +2640,17 @@ class TestBuilderWithSigner(unittest.TestCase):
2629
2640
  def test_add_ingredient_from_archive_roundtrip(self):
2630
2641
  manifest = {
2631
2642
  "claim_generator_info": [{"name": "c2pa-test", "version": "0.1.0"}],
2632
- "assertions": [],
2643
+ "assertions": [
2644
+ {
2645
+ "label": "c2pa.actions",
2646
+ "data": {
2647
+ "actions": [{
2648
+ "action": "c2pa.created",
2649
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
2650
+ }]
2651
+ }
2652
+ }
2653
+ ],
2633
2654
  }
2634
2655
  builder = Builder.from_json(manifest)
2635
2656
  ingredient_json = {
@@ -2662,7 +2683,17 @@ class TestBuilderWithSigner(unittest.TestCase):
2662
2683
  def test_add_ingredient_from_archive_preserves_instance_id(self):
2663
2684
  manifest = {
2664
2685
  "claim_generator_info": [{"name": "c2pa-test", "version": "0.1.0"}],
2665
- "assertions": [],
2686
+ "assertions": [
2687
+ {
2688
+ "label": "c2pa.actions",
2689
+ "data": {
2690
+ "actions": [{
2691
+ "action": "c2pa.created",
2692
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
2693
+ }]
2694
+ }
2695
+ }
2696
+ ],
2666
2697
  }
2667
2698
  archive_builder = Builder.from_json(manifest)
2668
2699
  ingredient_json = {
@@ -2695,7 +2726,17 @@ class TestBuilderWithSigner(unittest.TestCase):
2695
2726
  def test_add_ingredient_from_archive_preserves_instance_id_component_of(self):
2696
2727
  manifest = {
2697
2728
  "claim_generator_info": [{"name": "c2pa-test", "version": "1.0"}],
2698
- "assertions": [],
2729
+ "assertions": [
2730
+ {
2731
+ "label": "c2pa.actions",
2732
+ "data": {
2733
+ "actions": [{
2734
+ "action": "c2pa.created",
2735
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
2736
+ }]
2737
+ }
2738
+ }
2739
+ ],
2699
2740
  }
2700
2741
  archive_builder = Builder.from_json(manifest)
2701
2742
  ingredient_json = {
@@ -2729,7 +2770,17 @@ class TestBuilderWithSigner(unittest.TestCase):
2729
2770
  def test_add_ingredient_from_archive_preserves_instance_id_input_to(self):
2730
2771
  manifest = {
2731
2772
  "claim_generator_info": [{"name": "c2pa-test", "version": "1.0"}],
2732
- "assertions": [],
2773
+ "assertions": [
2774
+ {
2775
+ "label": "c2pa.actions",
2776
+ "data": {
2777
+ "actions": [{
2778
+ "action": "c2pa.created",
2779
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
2780
+ }]
2781
+ }
2782
+ }
2783
+ ],
2733
2784
  }
2734
2785
  archive_builder = Builder.from_json(manifest)
2735
2786
  ingredient_json = {
@@ -2763,7 +2814,17 @@ class TestBuilderWithSigner(unittest.TestCase):
2763
2814
  def test_add_ingredient_from_archive_roundtrip_parent_of(self):
2764
2815
  manifest = {
2765
2816
  "claim_generator_info": [{"name": "c2pa-test", "version": "1.0"}],
2766
- "assertions": [],
2817
+ "assertions": [
2818
+ {
2819
+ "label": "c2pa.actions",
2820
+ "data": {
2821
+ "actions": [{
2822
+ "action": "c2pa.created",
2823
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
2824
+ }]
2825
+ }
2826
+ }
2827
+ ],
2767
2828
  }
2768
2829
  builder = Builder.from_json(manifest)
2769
2830
  ingredient_json = {
@@ -2797,7 +2858,17 @@ class TestBuilderWithSigner(unittest.TestCase):
2797
2858
  def test_add_ingredient_from_archive_roundtrip_input_to(self):
2798
2859
  manifest = {
2799
2860
  "claim_generator_info": [{"name": "c2pa-test", "version": "1.0"}],
2800
- "assertions": [],
2861
+ "assertions": [
2862
+ {
2863
+ "label": "c2pa.actions",
2864
+ "data": {
2865
+ "actions": [{
2866
+ "action": "c2pa.created",
2867
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
2868
+ }]
2869
+ }
2870
+ }
2871
+ ],
2801
2872
  }
2802
2873
  builder = Builder.from_json(manifest)
2803
2874
  ingredient_json = {
@@ -2963,7 +3034,17 @@ class TestBuilderWithSigner(unittest.TestCase):
2963
3034
  def test_add_two_ingredient_archives_to_one_builder(self):
2964
3035
  manifest = {
2965
3036
  "claim_generator_info": [{"name": "c2pa-test", "version": "1.0"}],
2966
- "assertions": [],
3037
+ "assertions": [
3038
+ {
3039
+ "label": "c2pa.actions",
3040
+ "data": {
3041
+ "actions": [{
3042
+ "action": "c2pa.created",
3043
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
3044
+ }]
3045
+ }
3046
+ }
3047
+ ],
2967
3048
  }
2968
3049
  archives = []
2969
3050
  for title, instance_id in [("A.jpg", "ingredient-A"), ("B.jpg", "ingredient-B")]:
@@ -3001,7 +3082,17 @@ class TestBuilderWithSigner(unittest.TestCase):
3001
3082
  def test_write_ingredient_archive_only_contains_requested_ingredient(self):
3002
3083
  manifest = {
3003
3084
  "claim_generator_info": [{"name": "c2pa-test", "version": "1.0"}],
3004
- "assertions": [],
3085
+ "assertions": [
3086
+ {
3087
+ "label": "c2pa.actions",
3088
+ "data": {
3089
+ "actions": [{
3090
+ "action": "c2pa.created",
3091
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
3092
+ }]
3093
+ }
3094
+ }
3095
+ ],
3005
3096
  }
3006
3097
  archive_builder = Builder.from_json(manifest)
3007
3098
  for title, instance_id in [("A.jpg", "ingredient-A"), ("B.jpg", "ingredient-B")]:
@@ -3444,7 +3535,7 @@ class TestBuilderWithSigner(unittest.TestCase):
3444
3535
  # Test adding another ingredient
3445
3536
  ingredient_json = '{"test": "ingredient2"}'
3446
3537
  with open(self.testPath2, 'rb') as f:
3447
- builder.add_ingredient(ingredient_json, "image/png", f)
3538
+ builder.add_ingredient(ingredient_json, "image/jpeg", f)
3448
3539
 
3449
3540
  builder.close()
3450
3541
 
@@ -3464,7 +3555,7 @@ class TestBuilderWithSigner(unittest.TestCase):
3464
3555
  # Test adding another ingredient with a JSON string
3465
3556
  ingredient_json = '{"test": "ingredient2"}'
3466
3557
  with open(self.testPath2, 'rb') as f:
3467
- builder.add_ingredient(ingredient_json, "image/png", f)
3558
+ builder.add_ingredient(ingredient_json, "image/jpeg", f)
3468
3559
 
3469
3560
  builder.close()
3470
3561
 
@@ -3493,7 +3584,7 @@ class TestBuilderWithSigner(unittest.TestCase):
3493
3584
 
3494
3585
  ingredient_json = '{"test": "ingredient2"}'
3495
3586
  with open(self.testPath2, 'rb') as f:
3496
- builder.add_ingredient(ingredient_json, "image/png", f)
3587
+ builder.add_ingredient(ingredient_json, "image/jpeg", f)
3497
3588
 
3498
3589
  builder.close()
3499
3590
 
@@ -3551,7 +3642,7 @@ class TestBuilderWithSigner(unittest.TestCase):
3551
3642
 
3552
3643
  ingredient_json = '{"test": "ingredient2"}'
3553
3644
  with open(self.testPath2, 'rb') as f:
3554
- builder.add_ingredient(ingredient_json, "image/png", f)
3645
+ builder.add_ingredient(ingredient_json, "image/jpeg", f)
3555
3646
 
3556
3647
  builder.close()
3557
3648
 
@@ -5546,6 +5637,10 @@ class TestBuilderWithSigner(unittest.TestCase):
5546
5637
  "label": "c2pa.actions.v2",
5547
5638
  "data": {
5548
5639
  "actions": [
5640
+ {
5641
+ "action": "c2pa.created",
5642
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
5643
+ },
5549
5644
  {
5550
5645
  "action": "c2pa.placed",
5551
5646
  "parameters": {
@@ -5689,16 +5784,16 @@ class TestBuilderWithSigner(unittest.TestCase):
5689
5784
  "data": {
5690
5785
  "actions": [
5691
5786
  {
5692
- "action": "c2pa.placed",
5787
+ "action": "c2pa.opened",
5788
+ "digitalSourceType": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCreation",
5693
5789
  "parameters": {
5694
- "ingredientIds": ["ingredient-for-placed"]
5790
+ "ingredientIds": ["ingredient-for-opened"]
5695
5791
  },
5696
5792
  },
5697
5793
  {
5698
- "action": "c2pa.opened",
5699
- "digitalSourceType": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCreation",
5794
+ "action": "c2pa.placed",
5700
5795
  "parameters": {
5701
- "ingredientIds": ["ingredient-for-opened"]
5796
+ "ingredientIds": ["ingredient-for-placed"]
5702
5797
  },
5703
5798
  },
5704
5799
  ]
@@ -5781,6 +5876,10 @@ class TestBuilderWithSigner(unittest.TestCase):
5781
5876
  "label": "c2pa.actions.v2",
5782
5877
  "data": {
5783
5878
  "actions": [
5879
+ {
5880
+ "action": "c2pa.created",
5881
+ "digitalSourceType": "http://c2pa.org/digitalsourcetype/empty",
5882
+ },
5784
5883
  {
5785
5884
  "action": "c2pa.placed",
5786
5885
  "parameters": {
@@ -8539,9 +8638,13 @@ class TestManagedResourceObjects(TestContextAPIs):
8539
8638
  builder.close()
8540
8639
  builder.close()
8541
8640
 
8542
- # Only the replacement is must be freed here.
8641
+ # The replacement must be freed exactly once; a second close() is a
8642
+ # no-op. We don't separately assert original_handle's count here: the
8643
+ # native allocator may legally reuse the just-freed original address
8644
+ # for the replacement Box (same-size free-then-alloc within one FFI
8645
+ # call), so swapped_handle and original_handle can be the same
8646
+ # pointer value. The check above already covers that case correctly.
8543
8647
  self.assertEqual(self._free_count(freed, swapped_handle), 1)
8544
- self.assertEqual(self._free_count(freed, original_handle), 0)
8545
8648
 
8546
8649
  def test_repeated_swaps_on_one_builder(self):
8547
8650
  # Each with_archive consumes the handle the previous one returned, so
File without changes
File without changes
File without changes
File without changes
File without changes