Skip to content

Commit b3e5f55

Browse files
gpeacocktmathernalextrnnn
authored
feat: Rewrite to use new native bindings (no uniffi anymore)
* feat: Rewrite this repo to use pre-built c2pa_rs libraries and no direct Rust compilation * fix: Add sdk_version and get the current value from version() * build: work in progress on build updates * feat: Update c2pa.py (#105) * fix: Library loader * fix: Refactor * fix: Loader * fix: Clean up tests * fix: Some renaming going on (#106) * fix: Simplify build (#107) * fix: Some renaming going on * fix: Format * fix: Add scripts to debug builds, and clean env * fix: gitgnore * fix: Update makefile comments * fix: verbose debug logs * fix: Only keep the scripts we need * fix: Improve makefile * chore: rename 1 function * fix: Rename errors camel case * fix: Add debug logs to the loading of libs * fix: Format download logs * fix: Platform checks, download only one platform * fix: Load library, one test failure * feat: Add autopep8 formatting * fix: Dev rebuild * fix: Install package from local * fix: Temp deactivation of tests to debug publishing * fix: split install and wheel build step * fix: Debug Linux build * fix: Simplify deps graph * fix: Source dist * fix: Fix warning * fix: Restore macos_x86 * fix: Restore macos_aarch64 * fix: Restore windows step * fix: Introduce reusable workflow * fix: Permissions * fix: restore tests step * fix: Pytest is touchy about venv * fix: Missing deps * fix: split out windows tests * fix: split out windows tests 2 * fix: Rename steps * fix: Rename the steps * fix: Test graph * fix: name of actions * fix: Missing params * fix; conditional check * fix: auth requests to avoid rate limtis * fix: Dirs * fix: test wheel * fix: Just build * fix: Test wheels * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Version number check * fix: Version mismatch issue * fix: Rename wheels * fix: Build change * fix: follow-up text processing fix * fix: Drop bdist_wheel use * fix: Missed a spot * fix: License inclusion in wheel tweaks * fix: Add back the deny.toml file * fix: sdist build * fix: Clean up deps * fix: setuptools bug handling * fix: Better makefile * fix: deps oversight * fix: Split deps * fix: Space typo * fix: bump version * fix: Upload * fix: wheel upload debug * fix over-eager version up * fix over-eager version up * fix over-eager version up * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: fix warning * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * feat: manylinux support (#109) * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Update test setup * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Fix setups once more (#110) * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Update test setup * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Test * fix: Add test * fix: Refactor tests * fix: Reader test * fix: Update readme * fix: Docs * fix: Refactor * fix: benchmark * fix: CLeaning up * fix: Stream tests * fix: Reader tests * fix: Builder double close test * fix: Clean up * fix: Clean up * fix: Remove debug logs * fix: Fix typo * fix: Stream exception * fix: docs & more tests (#111) * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Update test setup * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Test * fix: Add test * fix: Refactor tests * fix: Reader test * fix: Update readme * fix: Docs * fix: Refactor * fix: benchmark * fix: CLeaning up * fix: Stream tests * fix: Reader tests * fix: Builder double close test * fix: Remove debug logs * fix: Fix typo * fix: Stream exception * fix: Threaded reading * fix: Threading tests * fix: Interleaved thread test * fix: Threading * fix: More tests * fix: Test updates * fix: Test updates * fix: Add some async tests * fix: Test updates * fix: Test updates * fix: Test updates * fix: Test updates * fix: Add ingredients tests * fix: Test ingredient * fix: Test ingredient * fix: Add ingredient from stream * fix: Ingredient from stream * fix: Reorder test * fix: Thread * fix: Threading with asyncio * fix: RUn all the tests * fix: refactor tests * fix: refactor and format * fix: refactor and format 2 * fix: benchmark * fix: FOrmat * fix: Add test for contention * fix: Add test for contention 2 * fix: Threads * fix: Paths use and some timing * fix: autopep8 * fix: Format * fix: Undo test formating as json formatting seems touchy * fix: test_read_ingredient_file * fix: format * fix: format * fix: fix a bug found by tests * fix: Refactor sign_file to use new API internally, but keep the emthod for compatibility * fix: Clean up * fix: CLean up * fix: Remove debug code * fix: Ignore deprecation warnings in test logs * fix: One more clean up * fix: One more clean up * feat: Prepare publishing flow to PyPi, increase test coverage (#108) * fix: Dev rebuild * fix: Install package from local * fix: Temp deactivation of tests to debug publishing * fix: split install and wheel build step * fix: Debug Linux build * fix: Simplify deps graph * fix: Source dist * fix: Fix warning * fix: Restore macos_x86 * fix: Restore macos_aarch64 * fix: Restore windows step * fix: Introduce reusable workflow * fix: Permissions * fix: restore tests step * fix: Pytest is touchy about venv * fix: Missing deps * fix: split out windows tests * fix: split out windows tests 2 * fix: Rename steps * fix: Rename the steps * fix: Test graph * fix: name of actions * fix: Missing params * fix; conditional check * fix: auth requests to avoid rate limtis * fix: Dirs * fix: test wheel * fix: Just build * fix: Test wheels * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Debug build * fix: Version number check * fix: Version mismatch issue * fix: Rename wheels * fix: Build change * fix: follow-up text processing fix * fix: Drop bdist_wheel use * fix: Missed a spot * fix: License inclusion in wheel tweaks * fix: Add back the deny.toml file * fix: sdist build * fix: Clean up deps * fix: setuptools bug handling * fix: Better makefile * fix: deps oversight * fix: Split deps * fix: Space typo * fix: bump version * fix: Upload * fix: wheel upload debug * fix over-eager version up * fix over-eager version up * fix over-eager version up * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: fix warning * fix: upload of wheels * fix: upload of wheels * feat: manylinux support (#109) * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Fix setups once more (#110) * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Update test setup * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Clean up * fix: Clean up * fix: docs & more tests (#111) * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Update test setup * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Test * fix: Add test * fix: Refactor tests * fix: Reader test * fix: Update readme * fix: Docs * fix: Refactor * fix: benchmark * fix: CLeaning up * fix: Stream tests * fix: Reader tests * fix: Builder double close test * fix: Remove debug logs * fix: Fix typo * fix: Stream exception * fix: Remove debig code * fix: Deps * feat: Simplify version number handling (#113) * feat: Improve version numbers handling * fix: Test build * fix: Test build * fix: Test build * fix: Test build * fix: Test build * fix: Test build * fix: Test build debug * fix: Test build debug * fix: Test build debug * fix: Test build debug * fix: Test build debug * fix: Test build debug * fix: Test build debug * fix: Test build debug * fix: Test build debug * fix: Test build debug * fix: fix makefile typo * fix: Test build debug * fix: Change build script * fix: Test build debug * fix: Test build debug * feat: Add (more) unit tests (#112) * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Update test setup * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: upload of wheels * fix: Test * fix: Add test * fix: Refactor tests * fix: Reader test * fix: Update readme * fix: Docs * fix: Refactor * fix: benchmark * fix: CLeaning up * fix: Stream tests * fix: Reader tests * fix: Builder double close test * fix: Remove debug logs * fix: Fix typo * fix: Stream exception * fix: Threaded reading * fix: Threading tests * fix: Interleaved thread test * fix: Threading * fix: More tests * fix: Test updates * fix: Test updates * fix: Add some async tests * fix: Test updates * fix: Test updates * fix: Test updates * fix: Test updates * fix: Add ingredients tests * fix: Test ingredient * fix: Test ingredient * fix: Add ingredient from stream * fix: Ingredient from stream * fix: Reorder test * fix: Thread * fix: Threading with asyncio * fix: RUn all the tests * fix: refactor tests * fix: refactor and format * fix: refactor and format 2 * fix: benchmark * fix: FOrmat * fix: Add test for contention * fix: Add test for contention 2 * fix: Threads * fix: Paths use and some timing * fix: autopep8 * fix: Format * fix: Undo test formating as json formatting seems touchy * fix: test_read_ingredient_file * fix: format * fix: format * fix: fix a bug found by tests * fix: Refactor sign_file to use new API internally, but keep the emthod for compatibility * fix: Clean up * fix: CLean up * fix: Remove debug code * fix: Ignore deprecation warnings in test logs * fix: One more clean up * fix: One more clean up * fix: Crypto up * fix: Readme * fix: update examples * fix: Examples * fix: Run examples as parts of tests * fix: undo previous change, but keep makefile helper * fix: Add tests for coverage * fix: Release reader from memory and typo * fix: Reset settings that would cause other test to fail * fix: Update authors * fix: Replace some tests values to use more modern assertions * fix: Change assertion * fix: Remove creative assertions * fix: Comment * fix: Refactor path names usage in tests * fix: Refactor path names usage in tests 2 * fix: Added a test case * fix: Refactor benchmark * fix: Target PyPi for release isntead of testPyPi --------- Co-authored-by: tmathern <[email protected]> Co-authored-by: Tania Mathern <[email protected]> Co-authored-by: Alex Tran <[email protected]> Co-authored-by: Alex <[email protected]>
1 parent 6d7cd9f commit b3e5f55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+7089
-1899
lines changed

.github/workflows/build-wheel.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: Build Wheel
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
architecture:
10+
required: false
11+
type: string
12+
artifact-name:
13+
required: true
14+
type: string
15+
runs-on:
16+
required: true
17+
type: string
18+
default: 'ubuntu-latest'
19+
c2pa-version:
20+
required: true
21+
type: string
22+
secrets:
23+
github-token:
24+
required: true
25+
26+
permissions:
27+
contents: read
28+
packages: read
29+
actions: read
30+
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.github-token }}
33+
C2PA_VERSION: ${{ inputs.c2pa-version }}
34+
35+
jobs:
36+
build:
37+
runs-on: ${{ inputs.runs-on }}
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Build Linux wheels
42+
if: runner.os == 'Linux'
43+
run: |
44+
# Create necessary directories
45+
mkdir -p artifacts
46+
mkdir -p src/c2pa/libs
47+
rm -rf dist build
48+
49+
# Set Docker image and platform tag based on architecture
50+
if [ "${{ inputs.architecture }}" = "aarch64" ]; then
51+
DOCKER_IMAGE="quay.io/pypa/manylinux_2_28_aarch64"
52+
PLATFORM_TAG="manylinux_2_28_aarch64"
53+
else
54+
DOCKER_IMAGE="quay.io/pypa/manylinux_2_28_x86_64"
55+
PLATFORM_TAG="manylinux_2_28_x86_64"
56+
fi
57+
58+
# Build wheel in Docker container
59+
docker run --rm -v $PWD:/io $DOCKER_IMAGE bash -c "
60+
yum install -y gcc gcc-c++ make &&
61+
mkdir -p /io/artifacts /io/src/c2pa/libs &&
62+
rm -rf /io/dist /io/build &&
63+
cd /io &&
64+
/opt/python/cp310-cp310/bin/pip install -r requirements.txt -r requirements-dev.txt &&
65+
/opt/python/cp310-cp310/bin/pip install toml &&
66+
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_VERSION &&
67+
for PYBIN in /opt/python/cp3{10,11}-*/bin; do
68+
\${PYBIN}/pip install --upgrade pip wheel &&
69+
\${PYBIN}/pip install toml &&
70+
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
71+
done &&
72+
rm -f /io/dist/*-linux_*.whl
73+
"
74+
75+
# Verify the wheel was built
76+
echo "Contents of dist directory:"
77+
ls -la dist/
78+
echo "Number of wheels found:"
79+
find dist -name "*.whl" | wc -l
80+
echo "Wheel filenames:"
81+
find dist -name "*.whl" -exec basename {} \;
82+
83+
- name: Build Windows wheel (x64)
84+
if: runner.os == 'Windows'
85+
shell: pwsh
86+
run: |
87+
# Create necessary directories
88+
New-Item -ItemType Directory -Force -Path artifacts
89+
New-Item -ItemType Directory -Force -Path src/c2pa/libs
90+
if (Test-Path dist) { Remove-Item -Recurse -Force dist }
91+
if (Test-Path build) { Remove-Item -Recurse -Force build }
92+
93+
# Install dependencies
94+
pip install -r requirements.txt
95+
pip install -r requirements-dev.txt
96+
pip install wheel
97+
98+
# Download native artifacts
99+
Write-Host "Starting artifact download process..."
100+
Write-Host "C2PA_VERSION: $env:C2PA_VERSION"
101+
102+
python scripts/download_artifacts.py "$env:C2PA_VERSION"
103+
104+
Write-Host "Artifacts directory contents:"
105+
Get-ChildItem -Recurse -Path artifacts
106+
Write-Host "src/c2pa/libs directory contents:"
107+
Get-ChildItem -Recurse -Path src/c2pa/libs
108+
109+
# Build wheel
110+
python setup.py bdist_wheel --plat-name win_amd64
111+
112+
- name: Build macOS wheel (Apple Silicon)
113+
if: runner.os == 'macOS' && runner.arch == 'arm64'
114+
run: |
115+
# Create necessary directories
116+
mkdir -p artifacts
117+
mkdir -p src/c2pa/libs
118+
rm -rf dist build
119+
120+
# Install dependencies
121+
pip install -r requirements.txt
122+
pip install -r requirements-dev.txt
123+
pip install wheel
124+
125+
# Download native artifacts
126+
python scripts/download_artifacts.py $C2PA_VERSION
127+
128+
# Build wheel
129+
python setup.py bdist_wheel --plat-name macosx_11_0_arm64
130+
131+
# Rename wheel to ensure unique filename
132+
cd dist
133+
for wheel in *.whl; do
134+
mv "$wheel" "${wheel/macosx_11_0_arm64/macosx_11_0_arm64}"
135+
done
136+
cd ..
137+
138+
- name: Log wheel filename
139+
if: runner.os == 'Linux' || runner.os == 'macOS'
140+
shell: bash
141+
run: |
142+
echo "Built wheel:"
143+
ls -l dist/*.whl
144+
145+
- name: Upload wheels
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: ${{ inputs.artifact-name }}
149+
path: dist
150+
if-no-files-found: error

0 commit comments

Comments
 (0)