From 85ebe7c99a802edc411372300062e22aca947e8a Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:05:11 -0700 Subject: [PATCH 01/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 62 +++++++++++++++---------------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 215c927f..ec06bea0 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -32,47 +32,43 @@ jobs: GITHUB_TOKEN: ${{ secrets.github-token }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - architecture: ${{ inputs.architecture }} - cache: "pip" - - name: Install dependencies - run: pip install -r requirements.txt - - name: Install project development dependencies - run: python -m pip install -r requirements-dev.txt - - name: Prepare build directories (Unix) - shell: bash + + - name: Build Linux wheels if: runner.os != 'Windows' run: | - mkdir -p artifacts - mkdir -p src/c2pa/libs - rm -rf dist build + docker run --rm -v $PWD:/io quay.io/pypa/manylinux_2_28_x86_64 bash -c " + yum install -y gcc gcc-c++ make && + mkdir -p /io/artifacts /io/src/c2pa/libs && + rm -rf /io/dist /io/build && + cd /io && + python3 scripts/download_artifacts.py c2pa-v0.55.0 && + pip install -r requirements.txt -r requirements-dev.txt && + for PYBIN in /opt/python/cp3{10,11}-*/bin; do + \${PYBIN}/pip install --upgrade pip wheel && + \${PYBIN}/python setup.py bdist_wheel + done && + for whl in dist/*.whl; do + auditwheel repair \"\$whl\" --plat manylinux_2_28_x86_64 -w dist/ + done && + rm -f dist/*-linux_*.whl + " - - name: Prepare build directories (Windows) - shell: pwsh + - name: Build Windows wheel if: runner.os == 'Windows' - run: | - New-Item -ItemType Directory -Force -Path artifacts - New-Item -ItemType Directory -Force -Path src/c2pa/libs - if (Test-Path dist) { Remove-Item -Recurse -Force dist } - if (Test-Path build) { Remove-Item -Recurse -Force build } - - name: Download native artifacts (from tag c2pa-v0.55.0) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: python3 scripts/download_artifacts.py c2pa-v0.55.0 - - name: Build wheel (Unix) - if: runner.os != 'Windows' + shell: pwsh run: | # Build wheel - python setup.py bdist_wheel + python setup.py bdist_wheel --plat-name win_amd64 - - name: Build wheel (Windows) - if: runner.os == 'Windows' - shell: pwsh + - name: Build macOS wheel (Intel) + if: runner.os == 'macOS' && runner.arch == 'x64' run: | - # Build wheel - python setup.py bdist_wheel + python setup.py bdist_wheel --plat-name macosx_10_9_x86_64 + + - name: Build macOS wheel (Apple Silicon) + if: runner.os == 'macOS' && runner.arch == 'arm64' + run: | + python setup.py bdist_wheel --plat-name macosx_11_0_arm64 - name: Log wheel filename shell: bash From bf1b7c1128d178bb9bf5e396d45be42d1016c872 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:09:05 -0700 Subject: [PATCH 02/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index ec06bea0..290bae9c 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -32,7 +32,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.github-token }} steps: - uses: actions/checkout@v4 - + - name: Build Linux wheels if: runner.os != 'Windows' run: | @@ -41,18 +41,28 @@ jobs: mkdir -p /io/artifacts /io/src/c2pa/libs && rm -rf /io/dist /io/build && cd /io && - python3 scripts/download_artifacts.py c2pa-v0.55.0 && - pip install -r requirements.txt -r requirements-dev.txt && + /opt/python/cp310-cp310/bin/pip install -r requirements.txt -r requirements-dev.txt && + /opt/python/cp310-cp310/bin/python scripts/download_artifacts.py c2pa-v0.55.0 && for PYBIN in /opt/python/cp3{10,11}-*/bin; do \${PYBIN}/pip install --upgrade pip wheel && \${PYBIN}/python setup.py bdist_wheel done && - for whl in dist/*.whl; do - auditwheel repair \"\$whl\" --plat manylinux_2_28_x86_64 -w dist/ + for whl in /io/dist/*.whl; do + auditwheel repair \"\$whl\" --plat manylinux_2_28_x86_64 -w /io/dist/ done && - rm -f dist/*-linux_*.whl + rm -f /io/dist/*-linux_*.whl " + - name: Verify Linux wheels + if: runner.os != 'Windows' + run: | + echo "Contents of dist directory:" + ls -la dist/ + echo "Number of wheels found:" + find dist -name "*.whl" | wc -l + echo "Wheel filenames:" + find dist -name "*.whl" -exec basename {} \; + - name: Build Windows wheel if: runner.os == 'Windows' shell: pwsh From 8f8361d0a91e90467706c9e56424aaeef2127004 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:09:43 -0700 Subject: [PATCH 03/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 290bae9c..f743c183 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -67,6 +67,20 @@ jobs: if: runner.os == 'Windows' shell: pwsh run: | + # Create necessary directories + New-Item -ItemType Directory -Force -Path artifacts + New-Item -ItemType Directory -Force -Path src/c2pa/libs + if (Test-Path dist) { Remove-Item -Recurse -Force dist } + if (Test-Path build) { Remove-Item -Recurse -Force build } + + # Install dependencies + pip install -r requirements.txt + pip install -r requirements-dev.txt + pip install wheel + + # Download native artifacts + python scripts/download_artifacts.py c2pa-v0.55.0 + # Build wheel python setup.py bdist_wheel --plat-name win_amd64 From 4b77a034bccfbf121b2ab8e777be9e50c67e551f Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:14:24 -0700 Subject: [PATCH 04/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 36 +++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index f743c183..6808f05f 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -45,7 +45,7 @@ jobs: /opt/python/cp310-cp310/bin/python scripts/download_artifacts.py c2pa-v0.55.0 && for PYBIN in /opt/python/cp3{10,11}-*/bin; do \${PYBIN}/pip install --upgrade pip wheel && - \${PYBIN}/python setup.py bdist_wheel + CFLAGS="-I/opt/python/cp310-cp310/include/python3.10" LDFLAGS="-L/opt/python/cp310-cp310/lib" \${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 done && for whl in /io/dist/*.whl; do auditwheel repair \"\$whl\" --plat manylinux_2_28_x86_64 -w /io/dist/ @@ -72,26 +72,54 @@ jobs: New-Item -ItemType Directory -Force -Path src/c2pa/libs if (Test-Path dist) { Remove-Item -Recurse -Force dist } if (Test-Path build) { Remove-Item -Recurse -Force build } - + # Install dependencies pip install -r requirements.txt pip install -r requirements-dev.txt pip install wheel - + # Download native artifacts python scripts/download_artifacts.py c2pa-v0.55.0 - + # Build wheel python setup.py bdist_wheel --plat-name win_amd64 - name: Build macOS wheel (Intel) if: runner.os == 'macOS' && runner.arch == 'x64' run: | + # Create necessary directories + mkdir -p artifacts + mkdir -p src/c2pa/libs + rm -rf dist build + + # Install dependencies + pip install -r requirements.txt + pip install -r requirements-dev.txt + pip install wheel + + # Download native artifacts + python scripts/download_artifacts.py c2pa-v0.55.0 + + # Build wheel python setup.py bdist_wheel --plat-name macosx_10_9_x86_64 - name: Build macOS wheel (Apple Silicon) if: runner.os == 'macOS' && runner.arch == 'arm64' run: | + # Create necessary directories + mkdir -p artifacts + mkdir -p src/c2pa/libs + rm -rf dist build + + # Install dependencies + pip install -r requirements.txt + pip install -r requirements-dev.txt + pip install wheel + + # Download native artifacts + python scripts/download_artifacts.py c2pa-v0.55.0 + + # Build wheel python setup.py bdist_wheel --plat-name macosx_11_0_arm64 - name: Log wheel filename From 2fe7ad9a78e29852ee9d6d975c3792d6a85b1c4f Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:17:44 -0700 Subject: [PATCH 05/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 6808f05f..e55777b2 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -34,7 +34,7 @@ jobs: - uses: actions/checkout@v4 - name: Build Linux wheels - if: runner.os != 'Windows' + if: runner.os == 'Linux' run: | docker run --rm -v $PWD:/io quay.io/pypa/manylinux_2_28_x86_64 bash -c " yum install -y gcc gcc-c++ make && From 5da91d50880d2e32b330f4648bdea30fe61fa754 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:19:56 -0700 Subject: [PATCH 06/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index e55777b2..13699a71 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -54,7 +54,7 @@ jobs: " - name: Verify Linux wheels - if: runner.os != 'Windows' + if: runner.os == 'Linux' run: | echo "Contents of dist directory:" ls -la dist/ @@ -123,6 +123,7 @@ jobs: python setup.py bdist_wheel --plat-name macosx_11_0_arm64 - name: Log wheel filename + if: runner.os == 'Linux' || runner.os == 'macOS' shell: bash run: | echo "Built wheel:" From 211ceeb89401535bf32acfef2ab02208968e779f Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:23:12 -0700 Subject: [PATCH 07/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 13699a71..e6fe4360 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -45,10 +45,7 @@ jobs: /opt/python/cp310-cp310/bin/python scripts/download_artifacts.py c2pa-v0.55.0 && for PYBIN in /opt/python/cp3{10,11}-*/bin; do \${PYBIN}/pip install --upgrade pip wheel && - CFLAGS="-I/opt/python/cp310-cp310/include/python3.10" LDFLAGS="-L/opt/python/cp310-cp310/lib" \${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 - done && - for whl in /io/dist/*.whl; do - auditwheel repair \"\$whl\" --plat manylinux_2_28_x86_64 -w /io/dist/ + CFLAGS=\"-I/opt/python/cp310-cp310/include/python3.10\" LDFLAGS=\"-L/opt/python/cp310-cp310/lib\" \${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 done && rm -f /io/dist/*-linux_*.whl " From 1e4c374c21c587ccb5aae14fa6e25386550af1ca Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:24:05 -0700 Subject: [PATCH 08/21] fix: upload of wheels --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 28303d25..1606789e 100644 --- a/setup.py +++ b/setup.py @@ -160,7 +160,7 @@ def find_available_platforms(): name="c2pa-python", version="0.10.8", package_dir={"": "src"}, - packages=find_namespace_packages(where="src", exclude=["c2pa.libs"]), + packages=find_namespace_packages(where="src"), include_package_data=True, package_data={ "c2pa": ["libs/*"], # Include all files in libs directory @@ -192,7 +192,7 @@ def find_available_platforms(): name="c2pa-python", version="0.10.8", package_dir={"": "src"}, - packages=find_namespace_packages(where="src", exclude=["c2pa.libs"]), + packages=find_namespace_packages(where="src"), include_package_data=True, package_data={ "c2pa": ["libs/*"], # Include all files in libs directory @@ -217,7 +217,7 @@ def find_available_platforms(): name="c2pa-python", version="0.10.8", package_dir={"": "src"}, - packages=find_namespace_packages(where="src", exclude=["c2pa.libs"]), + packages=find_namespace_packages(where="src"), include_package_data=True, package_data={ "c2pa": ["libs/*"], # Include all files in libs directory From 3f690127d66d518214c882a158eb689676d28d07 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:26:52 -0700 Subject: [PATCH 09/21] fix: upload of wheels --- pyproject.toml | 2 +- setup.py | 6 +++--- src/c2pa/__init__.py | 2 +- tests/_test_api.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0f017ea6..dfc1d43b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "c2pa-python" -version = "0.10.8" +version = "0.10.9" requires-python = ">=3.10" description = "Python bindings for the C2PA Content Authenticity Initiative (CAI) library" readme = { file = "README.md", content-type = "text/markdown" } diff --git a/setup.py b/setup.py index 1606789e..8f042026 100644 --- a/setup.py +++ b/setup.py @@ -158,7 +158,7 @@ def find_available_platforms(): print("No platform-specific libraries found. Building wheel without platform-specific libraries.") setup( name="c2pa-python", - version="0.10.8", + version="0.10.9", package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, @@ -190,7 +190,7 @@ def find_available_platforms(): # Build the wheel setup( name="c2pa-python", - version="0.10.8", + version="0.10.9", package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, @@ -215,7 +215,7 @@ def find_available_platforms(): # For sdist and development installation setup( name="c2pa-python", - version="0.10.8", + version="0.10.9", package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, diff --git a/src/c2pa/__init__.py b/src/c2pa/__init__.py index 213b07be..d39ad799 100644 --- a/src/c2pa/__init__.py +++ b/src/c2pa/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.10.8" +__version__ = "0.10.9" from .c2pa import ( Builder, diff --git a/tests/_test_api.py b/tests/_test_api.py index d644d068..a5a6c265 100644 --- a/tests/_test_api.py +++ b/tests/_test_api.py @@ -63,7 +63,7 @@ def getitem(d, key): class TestC2paSdk(unittest.TestCase): def test_version(self): - assert version() == "0.10.8" + assert version() == "0.10.9" def test_sdk_version(self): assert "c2pa-rs/" in sdk_version() From 091758ad4fe01c6c0dc87b2bcf48154514b51b4a Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:46:29 -0700 Subject: [PATCH 10/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 17 ++++++++++++++++- pyproject.toml | 2 +- setup.py | 6 +++--- src/c2pa/__init__.py | 2 +- tests/_test_api.py | 2 +- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index e6fe4360..d557459c 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -100,6 +100,13 @@ jobs: # Build wheel python setup.py bdist_wheel --plat-name macosx_10_9_x86_64 + # Rename wheel to ensure unique filename + cd dist + for wheel in *.whl; do + mv "$wheel" "${wheel/macosx_10_9_x86_64/macosx_10_9_intel}" + done + cd .. + - name: Build macOS wheel (Apple Silicon) if: runner.os == 'macOS' && runner.arch == 'arm64' run: | @@ -119,6 +126,13 @@ jobs: # Build wheel python setup.py bdist_wheel --plat-name macosx_11_0_arm64 + # Rename wheel to ensure unique filename + cd dist + for wheel in *.whl; do + mv "$wheel" "${wheel/macosx_11_0_arm64/macosx_11_0_arm64}" + done + cd .. + - name: Log wheel filename if: runner.os == 'Linux' || runner.os == 'macOS' shell: bash @@ -130,4 +144,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ inputs.artifact-name }} - path: dist \ No newline at end of file + path: dist + if-no-files-found: error \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index dfc1d43b..fa785514 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "c2pa-python" -version = "0.10.9" +version = "0.10.10" requires-python = ">=3.10" description = "Python bindings for the C2PA Content Authenticity Initiative (CAI) library" readme = { file = "README.md", content-type = "text/markdown" } diff --git a/setup.py b/setup.py index 8f042026..2693f447 100644 --- a/setup.py +++ b/setup.py @@ -158,7 +158,7 @@ def find_available_platforms(): print("No platform-specific libraries found. Building wheel without platform-specific libraries.") setup( name="c2pa-python", - version="0.10.9", + version="0.10.10", package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, @@ -190,7 +190,7 @@ def find_available_platforms(): # Build the wheel setup( name="c2pa-python", - version="0.10.9", + version="0.10.10", package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, @@ -215,7 +215,7 @@ def find_available_platforms(): # For sdist and development installation setup( name="c2pa-python", - version="0.10.9", + version="0.10.10", package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, diff --git a/src/c2pa/__init__.py b/src/c2pa/__init__.py index d39ad799..c4231730 100644 --- a/src/c2pa/__init__.py +++ b/src/c2pa/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.10.9" +__version__ = "0.10.10" from .c2pa import ( Builder, diff --git a/tests/_test_api.py b/tests/_test_api.py index a5a6c265..8c83546d 100644 --- a/tests/_test_api.py +++ b/tests/_test_api.py @@ -63,7 +63,7 @@ def getitem(d, key): class TestC2paSdk(unittest.TestCase): def test_version(self): - assert version() == "0.10.9" + assert version() == "0.10.10" def test_sdk_version(self): assert "c2pa-rs/" in sdk_version() From 184584dbb20ecd2d82b9c4ab27f4639e2a622b04 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:55:09 -0700 Subject: [PATCH 11/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 49 ++++++++++++------------------- .github/workflows/build.yml | 9 +++--- 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index d557459c..e3656cad 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -36,7 +36,22 @@ jobs: - name: Build Linux wheels if: runner.os == 'Linux' run: | - docker run --rm -v $PWD:/io quay.io/pypa/manylinux_2_28_x86_64 bash -c " + # Create necessary directories + mkdir -p artifacts + mkdir -p src/c2pa/libs + rm -rf dist build + + # Set Docker image and platform tag based on architecture + if [ "${{ inputs.architecture }}" = "aarch64" ]; then + DOCKER_IMAGE="quay.io/pypa/manylinux_2_28_aarch64" + PLATFORM_TAG="manylinux_2_28_aarch64" + else + DOCKER_IMAGE="quay.io/pypa/manylinux_2_28_x86_64" + PLATFORM_TAG="manylinux_2_28_x86_64" + fi + + # Build wheel in Docker container + docker run --rm -v $PWD:/io $DOCKER_IMAGE bash -c " yum install -y gcc gcc-c++ make && mkdir -p /io/artifacts /io/src/c2pa/libs && rm -rf /io/dist /io/build && @@ -45,14 +60,12 @@ jobs: /opt/python/cp310-cp310/bin/python scripts/download_artifacts.py c2pa-v0.55.0 && for PYBIN in /opt/python/cp3{10,11}-*/bin; do \${PYBIN}/pip install --upgrade pip wheel && - CFLAGS=\"-I/opt/python/cp310-cp310/include/python3.10\" LDFLAGS=\"-L/opt/python/cp310-cp310/lib\" \${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 + CFLAGS=\"-I/opt/python/cp310-cp310/include/python3.10\" LDFLAGS=\"-L/opt/python/cp310-cp310/lib\" \${PYBIN}/python setup.py bdist_wheel --plat-name $PLATFORM_TAG done && rm -f /io/dist/*-linux_*.whl " - - name: Verify Linux wheels - if: runner.os == 'Linux' - run: | + # Verify the wheel was built echo "Contents of dist directory:" ls -la dist/ echo "Number of wheels found:" @@ -81,32 +94,6 @@ jobs: # Build wheel python setup.py bdist_wheel --plat-name win_amd64 - - name: Build macOS wheel (Intel) - if: runner.os == 'macOS' && runner.arch == 'x64' - run: | - # Create necessary directories - mkdir -p artifacts - mkdir -p src/c2pa/libs - rm -rf dist build - - # Install dependencies - pip install -r requirements.txt - pip install -r requirements-dev.txt - pip install wheel - - # Download native artifacts - python scripts/download_artifacts.py c2pa-v0.55.0 - - # Build wheel - python setup.py bdist_wheel --plat-name macosx_10_9_x86_64 - - # Rename wheel to ensure unique filename - cd dist - for wheel in *.whl; do - mv "$wheel" "${wheel/macosx_10_9_x86_64/macosx_10_9_intel}" - done - cd .. - - name: Build macOS wheel (Apple Silicon) if: runner.os == 'macOS' && runner.arch == 'arm64' run: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66c9c566..81ae9ddb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,6 +154,7 @@ jobs: needs: tests-unix with: python-version: "3.10" + architecture: ${{ matrix.target }} artifact-name: wheels-linux-${{ matrix.target }} runs-on: ubuntu-latest secrets: @@ -236,7 +237,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} strategy: matrix: - target: [x64, x86] + target: [x64] if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || @@ -250,7 +251,7 @@ jobs: runs-on: windows-latest strategy: matrix: - target: [x64, x86] + target: [x64] if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || @@ -313,7 +314,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} strategy: matrix: - target: [x86_64, aarch64] + target: [aarch64] if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || @@ -327,7 +328,7 @@ jobs: runs-on: macos-latest strategy: matrix: - target: [x86_64, aarch64] + target: [aarch64] if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || From b981e45c284ae1abf9d9555188c5e39faa41b28f Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 16:55:20 -0700 Subject: [PATCH 12/21] fix: upload of wheels --- pyproject.toml | 2 +- setup.py | 6 +++--- src/c2pa/__init__.py | 2 +- tests/_test_api.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fa785514..0d1cd3c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "c2pa-python" -version = "0.10.10" +version = "0.10.11" requires-python = ">=3.10" description = "Python bindings for the C2PA Content Authenticity Initiative (CAI) library" readme = { file = "README.md", content-type = "text/markdown" } diff --git a/setup.py b/setup.py index 2693f447..d552a87f 100644 --- a/setup.py +++ b/setup.py @@ -158,7 +158,7 @@ def find_available_platforms(): print("No platform-specific libraries found. Building wheel without platform-specific libraries.") setup( name="c2pa-python", - version="0.10.10", + version="0.10.11", package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, @@ -190,7 +190,7 @@ def find_available_platforms(): # Build the wheel setup( name="c2pa-python", - version="0.10.10", + version="0.10.11", package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, @@ -215,7 +215,7 @@ def find_available_platforms(): # For sdist and development installation setup( name="c2pa-python", - version="0.10.10", + version="0.10.11", package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, diff --git a/src/c2pa/__init__.py b/src/c2pa/__init__.py index c4231730..9d304840 100644 --- a/src/c2pa/__init__.py +++ b/src/c2pa/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.10.10" +__version__ = "0.10.11" from .c2pa import ( Builder, diff --git a/tests/_test_api.py b/tests/_test_api.py index 8c83546d..9aae98e9 100644 --- a/tests/_test_api.py +++ b/tests/_test_api.py @@ -63,7 +63,7 @@ def getitem(d, key): class TestC2paSdk(unittest.TestCase): def test_version(self): - assert version() == "0.10.10" + assert version() == "0.10.11" def test_sdk_version(self): assert "c2pa-rs/" in sdk_version() From 71a1d8bb3e22c0fde52efbfce3b4eb91f4801678 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 17:00:19 -0700 Subject: [PATCH 13/21] fix: upload of wheels --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81ae9ddb..310f8e79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -156,12 +156,16 @@ jobs: python-version: "3.10" architecture: ${{ matrix.target }} artifact-name: wheels-linux-${{ matrix.target }} - runs-on: ubuntu-latest + runs-on: ${{ matrix.runs-on }} secrets: github-token: ${{ secrets.GITHUB_TOKEN }} strategy: matrix: - target: [x86_64, aarch64] + include: + - target: x86_64 + runs-on: ubuntu-latest + - target: aarch64 + runs-on: ubuntu-latest-arm64 if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || From 1a631ed0d12c4491080ca017eb025b0cad3e46d7 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 17:08:58 -0700 Subject: [PATCH 14/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 2 +- .github/workflows/build.yml | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index e3656cad..3e67dbf4 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -73,7 +73,7 @@ jobs: echo "Wheel filenames:" find dist -name "*.whl" -exec basename {} \; - - name: Build Windows wheel + - name: Build Windows wheel (x64) if: runner.os == 'Windows' shell: pwsh run: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 310f8e79..3cf5b7ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,7 @@ jobs: - target: x86_64 runs-on: ubuntu-latest - target: aarch64 - runs-on: ubuntu-latest-arm64 + runs-on: ubuntu-24.04-arm if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || @@ -443,14 +443,6 @@ jobs: echo "Last modified: $(stat -f %Sm "$file")" echo "---" done - echo "=== Platform-specific artifacts ===" - echo "Linux x86_64: $(ls -l dist/wheels-linux-x86_64/* 2>/dev/null || echo 'Not found')" - echo "Linux aarch64: $(ls -l dist/wheels-linux-aarch64/* 2>/dev/null || echo 'Not found')" - echo "macOS x86_64: $(ls -l dist/wheels-macos-x86_64/* 2>/dev/null || echo 'Not found')" - echo "macOS aarch64: $(ls -l dist/wheels-macos-aarch64/* 2>/dev/null || echo 'Not found')" - echo "Windows x64: $(ls -l dist/wheels-windows-x64/* 2>/dev/null || echo 'Not found')" - echo "Windows x86: $(ls -l dist/wheels-windows-x86/* 2>/dev/null || echo 'Not found')" - echo "SDist: $(ls -l dist/wheels-sdist/* 2>/dev/null || echo 'Not found')" - name: Debug - List final dist directory run: | echo "=== Final dist directory contents ===" From c40da612cac7148744fd02dfc29fbc487b004ef7 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 17:14:04 -0700 Subject: [PATCH 15/21] fix: Update test setup --- .github/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3cf5b7ed..ae912d04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -163,7 +163,7 @@ jobs: matrix: include: - target: x86_64 - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 - target: aarch64 runs-on: ubuntu-24.04-arm if: | @@ -176,10 +176,14 @@ jobs: test-built-linux-wheel: name: Test Linux built wheel needs: build-linux-wheel - runs-on: ubuntu-latest + runs-on: ${{ matrix.runs-on }} strategy: matrix: - target: [x86_64, aarch64] + include: + - target: x86_64 + runs-on: ubuntu-24.04 + - target: aarch64 + runs-on: ubuntu-24.04-arm if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || From 0a4c3478910b1c0ca465ac05263323a12bb54e82 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 17:26:13 -0700 Subject: [PATCH 16/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 2 +- .github/workflows/build.yml | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 3e67dbf4..3d10ce9b 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -57,7 +57,7 @@ jobs: rm -rf /io/dist /io/build && cd /io && /opt/python/cp310-cp310/bin/pip install -r requirements.txt -r requirements-dev.txt && - /opt/python/cp310-cp310/bin/python scripts/download_artifacts.py c2pa-v0.55.0 && + C2PA_LIBS_PLATFORM=\"${{ inputs.architecture == 'aarch64' && 'aarch64-unknown-linux-gnu' || 'x86_64-unknown-linux-gnu' }}\" /opt/python/cp310-cp310/bin/python scripts/download_artifacts.py c2pa-v0.55.0 && for PYBIN in /opt/python/cp3{10,11}-*/bin; do \${PYBIN}/pip install --upgrade pip wheel && CFLAGS=\"-I/opt/python/cp310-cp310/include/python3.10\" LDFLAGS=\"-L/opt/python/cp310-cp310/lib\" \${PYBIN}/python setup.py bdist_wheel --plat-name $PLATFORM_TAG diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae912d04..63340094 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -164,8 +164,6 @@ jobs: include: - target: x86_64 runs-on: ubuntu-24.04 - - target: aarch64 - runs-on: ubuntu-24.04-arm if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || @@ -182,8 +180,6 @@ jobs: include: - target: x86_64 runs-on: ubuntu-24.04 - - target: aarch64 - runs-on: ubuntu-24.04-arm if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || From 64deb6787479d4c0f0d801d173e7d8c8009448d9 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 17:35:03 -0700 Subject: [PATCH 17/21] fix: upload of wheels --- setup.cfg | 2 +- setup.py | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/setup.cfg b/setup.cfg index 844b16b5..4e44223f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = c2pa -version = 1.0.0 +version = 0.10.11 description = Python bindings for the C2PA library long_description = file: README.md long_description_content_type = text/markdown diff --git a/setup.py b/setup.py index d552a87f..489c070d 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,16 @@ from setuptools import setup, find_namespace_packages import sys -import os import platform import shutil from pathlib import Path +import toml + +# Read version from pyproject.toml +def get_version(): + pyproject = toml.load("pyproject.toml") + return pyproject["project"]["version"] + +VERSION = get_version() # Define platform to library extension mapping (for reference only) PLATFORM_EXTENSIONS = { @@ -158,7 +165,7 @@ def find_available_platforms(): print("No platform-specific libraries found. Building wheel without platform-specific libraries.") setup( name="c2pa-python", - version="0.10.11", + version=VERSION, package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, @@ -190,7 +197,7 @@ def find_available_platforms(): # Build the wheel setup( name="c2pa-python", - version="0.10.11", + version=VERSION, package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, @@ -215,7 +222,7 @@ def find_available_platforms(): # For sdist and development installation setup( name="c2pa-python", - version="0.10.11", + version=VERSION, package_dir={"": "src"}, packages=find_namespace_packages(where="src"), include_package_data=True, From b9a8f97e69f3bb97db07253de79c3b82580bd871 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 17:38:23 -0700 Subject: [PATCH 18/21] fix: upload of wheels --- pyproject.toml | 4 ++-- setup.cfg | 16 ---------------- src/c2pa/__init__.py | 2 +- tests/_test_api.py | 2 +- 4 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 0d1cd3c3..0faf4ea4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools>=68.0.0", "wheel"] +requires = ["setuptools>=68.0.0", "wheel", "toml>=0.10.2"] build-backend = "setuptools.build_meta" [project] name = "c2pa-python" -version = "0.10.11" +version = "0.10.12" requires-python = ">=3.10" description = "Python bindings for the C2PA Content Authenticity Initiative (CAI) library" readme = { file = "README.md", content-type = "text/markdown" } diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 4e44223f..00000000 --- a/setup.cfg +++ /dev/null @@ -1,16 +0,0 @@ -[metadata] -name = c2pa -version = 0.10.11 -description = Python bindings for the C2PA library -long_description = file: README.md -long_description_content_type = text/markdown -license = MIT OR Apache-2.0 - -[options] -package_dir = - = src -packages = find: -include_package_data = True - -[options.packages.find] -where = src \ No newline at end of file diff --git a/src/c2pa/__init__.py b/src/c2pa/__init__.py index 9d304840..f5cd278e 100644 --- a/src/c2pa/__init__.py +++ b/src/c2pa/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.10.11" +__version__ = "0.10.12" from .c2pa import ( Builder, diff --git a/tests/_test_api.py b/tests/_test_api.py index 9aae98e9..059564aa 100644 --- a/tests/_test_api.py +++ b/tests/_test_api.py @@ -63,7 +63,7 @@ def getitem(d, key): class TestC2paSdk(unittest.TestCase): def test_version(self): - assert version() == "0.10.11" + assert version() == "0.10.12" def test_sdk_version(self): assert "c2pa-rs/" in sdk_version() From c4e36d40a3dc1a60510400b7c795bd34c8055855 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 17:41:31 -0700 Subject: [PATCH 19/21] fix: upload of wheels --- .github/workflows/build.yml | 2 ++ pyproject.toml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63340094..a0a190b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -399,6 +399,8 @@ jobs: cache: "pip" - name: Install dependencies run: pip install -r requirements.txt + - name: Install dev dependencies for build + run: pip install -r requirements-dev.txt - name: Build sdist run: python setup.py sdist - name: Upload sdist diff --git a/pyproject.toml b/pyproject.toml index 0faf4ea4..04390229 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,5 +37,6 @@ test = [ [project.scripts] download-artifacts = "c2pa.build:download_artifacts" +# Workaround to prevent setuptools from automatically including invalid metadata [tool.setuptools] license-files = [] From f58304c3a11e92184489fcd7aa5be257c54e9556 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 17:46:20 -0700 Subject: [PATCH 20/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 1 + .github/workflows/build.yml | 21 --------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 3d10ce9b..6813578a 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -57,6 +57,7 @@ jobs: rm -rf /io/dist /io/build && cd /io && /opt/python/cp310-cp310/bin/pip install -r requirements.txt -r requirements-dev.txt && + /opt/python/cp310-cp310/bin/pip install toml && C2PA_LIBS_PLATFORM=\"${{ inputs.architecture == 'aarch64' && 'aarch64-unknown-linux-gnu' || 'x86_64-unknown-linux-gnu' }}\" /opt/python/cp310-cp310/bin/python scripts/download_artifacts.py c2pa-v0.55.0 && for PYBIN in /opt/python/cp3{10,11}-*/bin; do \${PYBIN}/pip install --upgrade pip wheel && diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0a190b7..625040b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -422,33 +422,12 @@ jobs: - uses: actions/checkout@v4 - name: Create dist directory run: mkdir -p dist - - name: Debug - List dist before download - run: | - echo "=== Dist directory before download ===" - ls -la dist/ || echo "dist is empty" - name: Download all wheels uses: actions/download-artifact@v4 with: pattern: wheels-* path: dist merge-multiple: true - - name: Debug - List downloaded artifacts - run: | - echo "=== Downloaded artifacts structure ===" - find dist -type f -ls - echo "=== Downloaded artifacts contents ===" - ls -R dist/ - echo "=== Artifact details ===" - for file in dist/*; do - echo "File: $file" - echo "Size: $(stat -f %z "$file")" - echo "Last modified: $(stat -f %Sm "$file")" - echo "---" - done - - name: Debug - List final dist directory - run: | - echo "=== Final dist directory contents ===" - ls -la dist/ || echo "dist is empty" - name: Publish to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From 0f94d4c12578a7dfd4d13df2a6f1f790f346d68e Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 30 May 2025 17:49:06 -0700 Subject: [PATCH 21/21] fix: upload of wheels --- .github/workflows/build-wheel.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 6813578a..ca6aae2d 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -25,11 +25,12 @@ permissions: packages: read actions: read +env: + GITHUB_TOKEN: ${{ secrets.github-token }} + jobs: build: runs-on: ${{ inputs.runs-on }} - env: - GITHUB_TOKEN: ${{ secrets.github-token }} steps: - uses: actions/checkout@v4 @@ -61,6 +62,7 @@ jobs: C2PA_LIBS_PLATFORM=\"${{ inputs.architecture == 'aarch64' && 'aarch64-unknown-linux-gnu' || 'x86_64-unknown-linux-gnu' }}\" /opt/python/cp310-cp310/bin/python scripts/download_artifacts.py c2pa-v0.55.0 && for PYBIN in /opt/python/cp3{10,11}-*/bin; do \${PYBIN}/pip install --upgrade pip wheel && + \${PYBIN}/pip install toml && CFLAGS=\"-I/opt/python/cp310-cp310/include/python3.10\" LDFLAGS=\"-L/opt/python/cp310-cp310/lib\" \${PYBIN}/python setup.py bdist_wheel --plat-name $PLATFORM_TAG done && rm -f /io/dist/*-linux_*.whl