-
Notifications
You must be signed in to change notification settings - Fork 23
feat: Rewrite this repo to use pre-built c2pa_rs libraries and no dir… #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
189 commits
Select commit
Hold shift + click to select a range
c171ed6
feat: Rewrite this repo to use pre-built c2pa_rs libraries and no dir…
gpeacock 31fd9a7
Merge branch 'main' into gpeacock/no_rust
gpeacock 2bb3def
fix: Add sdk_version and get the current value from version()
gpeacock 97ad247
build: work in progress on build updates
gpeacock c68399c
feat: Update c2pa.py (#105)
tmathern 44b5229
feat: Add autopep8 formatting
tmathern c843775
fix: Dev rebuild
tmathern e0b9bf3
fix: Install package from local
tmathern 7fdb6e3
fix: Temp deactivation of tests to debug publishing
tmathern 0b580e3
fix: split install and wheel build step
tmathern b885d6f
fix: Debug Linux build
tmathern e9ede9b
fix: Simplify deps graph
tmathern 2a9911d
fix: Source dist
tmathern 4380c4f
fix: Fix warning
tmathern a8ca466
fix: Restore macos_x86
tmathern 5ad5832
fix: Restore macos_aarch64
tmathern 737d418
fix: Restore windows step
tmathern 251169f
fix: Introduce reusable workflow
tmathern 13ccf44
fix: Permissions
tmathern 883580a
fix: restore tests step
tmathern d46ab70
fix: Pytest is touchy about venv
tmathern 650da56
fix: Missing deps
tmathern 3c667f9
fix: split out windows tests
tmathern 98f6216
fix: split out windows tests 2
tmathern 8b3b3f6
fix: Rename steps
tmathern 2368fa3
fix: Rename the steps
tmathern 45a00d2
fix: Test graph
tmathern d2d8a7c
fix: name of actions
tmathern 74b6793
fix: Missing params
tmathern f7111dd
fix; conditional check
tmathern d641cff
fix: auth requests to avoid rate limtis
tmathern 3b9ff40
fix: Dirs
tmathern bf8d4aa
fix: test wheel
tmathern 31d73b0
fix: Just build
tmathern 0638914
fix: Test wheels
tmathern 3bc7b26
fix: Debug build
tmathern 7e04776
fix: Debug build
tmathern 75783d1
fix: Debug build
tmathern 9464426
fix: Debug build
tmathern 5a4213c
fix: Debug build
tmathern a360278
fix: Debug build
tmathern b23bb1c
fix: Debug build
tmathern 3c74b32
fix: Debug build
tmathern e322562
fix: Debug build
tmathern ac90962
fix: Version number check
tmathern 86f697b
fix: Version mismatch issue
tmathern 3ccc9f3
fix: Rename wheels
tmathern 824ec7d
fix: Build change
tmathern c3b0fb4
fix: follow-up text processing fix
tmathern 659cf01
fix: Drop bdist_wheel use
tmathern 8129de2
fix: Missed a spot
tmathern c86dfdb
fix: License inclusion in wheel tweaks
tmathern 472e1c3
fix: Add back the deny.toml file
tmathern 2b7ffcb
fix: sdist build
tmathern 4b035b9
fix: Clean up deps
tmathern ddfbd76
fix: setuptools bug handling
tmathern ed21cb9
fix: Better makefile
tmathern dda8a5d
fix: deps oversight
tmathern 825f841
fix: Split deps
tmathern c51ca63
fix: Space typo
tmathern 6ff7c78
fix: bump version
tmathern 70f98d4
fix: Upload
tmathern 266982d
fix: wheel upload debug
tmathern f758144
fix over-eager version up
tmathern 4a8ea4d
fix over-eager version up
tmathern 6abb067
fix over-eager version up
tmathern 38d61a7
fix: upload of wheels
tmathern 34aa16c
fix: upload of wheels
tmathern 9c71f70
fix: upload of wheels
tmathern 24c2465
fix: upload of wheels
tmathern 2f844ed
fix: upload of wheels
tmathern b1b908b
fix: upload of wheels
tmathern 8e73614
fix: upload of wheels
tmathern 226bc77
fix: upload of wheels
tmathern 9e320c9
fix: upload of wheels
tmathern d900d85
fix: upload of wheels
tmathern bb28119
fix: upload of wheels
tmathern db0d184
fix: upload of wheels
tmathern 2af8e13
fix: upload of wheels
tmathern 05aa171
fix: upload of wheels
tmathern 5252007
fix: fix warning
tmathern 2492b88
fix: upload of wheels
tmathern 6ae1e65
fix: upload of wheels
tmathern 85ebe7c
fix: upload of wheels
tmathern bf1b7c1
fix: upload of wheels
tmathern 8f8361d
fix: upload of wheels
tmathern 4b77a03
fix: upload of wheels
tmathern 2fe7ad9
fix: upload of wheels
tmathern 5da91d5
fix: upload of wheels
tmathern 211ceeb
fix: upload of wheels
tmathern 1e4c374
fix: upload of wheels
tmathern 3f69012
fix: upload of wheels
tmathern 382187b
feat: manylinux support (#109)
tmathern 091758a
fix: upload of wheels
tmathern 184584d
fix: upload of wheels
tmathern b981e45
fix: upload of wheels
tmathern 71a1d8b
fix: upload of wheels
tmathern 1a631ed
fix: upload of wheels
tmathern c40da61
fix: Update test setup
tmathern 0a4c347
fix: upload of wheels
tmathern b2b3603
fix: merge commit
tmathern 64deb67
fix: upload of wheels
tmathern b9a8f97
fix: upload of wheels
tmathern c4e36d4
fix: upload of wheels
tmathern f58304c
fix: upload of wheels
tmathern 0f94d4c
fix: upload of wheels
tmathern 62c0aa0
fix: Fix setups once more (#110)
tmathern ee12132
fix: Test
tmathern b3371b7
fix: Add test
tmathern f5623ab
fix: Refactor tests
tmathern bfdca20
fix: Reader test
tmathern 1cc2e29
fix: Update readme
tmathern 83f8af0
fix: Docs
tmathern 15e0e22
fix: Refactor
tmathern 905e4b2
fix: benchmark
tmathern 2c9e44b
fix: CLeaning up
tmathern 5ad9392
fix: Stream tests
tmathern d17f373
fix: Reader tests
tmathern 4de674b
fix: Builder double close test
tmathern 6e78c6c
fix: Clean up
tmathern 3a51eae
Resolve merge conflict: Keep updated version of tests/_test_api.py fr…
tmathern 84a6103
fix: Clean up
tmathern 050ca3c
ci: Merge branch 'mathern/pypitest-setup' into mathern/manywheels
tmathern a47891a
fix: Remove debug logs
tmathern bd148f2
fix: Fix typo
tmathern dcb862c
fix: Stream exception
tmathern 0b22cea
fix: docs & more tests (#111)
tmathern 7273647
fix: Threaded reading
tmathern b61f5c5
fix: Threading tests
tmathern 9620ff0
fix: Interleaved thread test
tmathern 811cf93
fix: Threading
tmathern 6f9544c
fix: More tests
tmathern 9057f20
fix: Test updates
tmathern dbd3ad2
fix: Test updates
tmathern 9abd7a7
fix: Add some async tests
tmathern 04f240d
fix: Test updates
tmathern b8aefa8
fix: Test updates
tmathern 862470e
fix: Test updates
tmathern 1b08ff8
fix: Test updates
tmathern 7c3a0b5
fix: Add ingredients tests
tmathern 26b44ef
fix: Test ingredient
tmathern 6ec6434
fix: Test ingredient
tmathern 195322f
fix: Add ingredient from stream
tmathern bc616d2
fix: Ingredient from stream
tmathern f3f7f6c
fix: Reorder test
tmathern 60ac0d8
fix: Thread
tmathern d1dad05
fix: Threading with asyncio
tmathern ad71126
fix: RUn all the tests
tmathern 3dbf41f
fix: refactor tests
tmathern 0e2e674
fix: refactor and format
tmathern 19eaa2e
fix: refactor and format 2
tmathern dbad283
ci: Merge commit
tmathern c7decbe
fix: benchmark
tmathern 92664d9
fix: FOrmat
tmathern 3f8c8a7
fix: Add test for contention
tmathern 9f73274
fix: Add test for contention 2
tmathern 9d922f6
fix: Threads
tmathern 811950a
fix: Paths use and some timing
tmathern 3147903
fix: autopep8
tmathern 2392e15
fix: Format
tmathern 575821c
fix: Undo test formating as json formatting seems touchy
tmathern 3d5e7e2
fix: test_read_ingredient_file
tmathern 68ba961
fix: format
tmathern 8cc4dc9
fix: format
tmathern b3d5926
fix: fix a bug found by tests
tmathern 8bceb5b
fix: Refactor sign_file to use new API internally, but keep the emtho…
tmathern cb7187c
fix: Clean up
tmathern 91d1b66
fix: CLean up
tmathern 5dbc6a7
fix: Remove debug code
tmathern 128508c
fix: Ignore deprecation warnings in test logs
tmathern 9dddb72
fix: One more clean up
tmathern 8f94192
fix: One more clean up
tmathern c19e8e2
feat: Prepare publishing flow to PyPi, increase test coverage (#108)
tmathern 92af391
fix: Add tests for coverage
alextrnnn 6f51e55
Merge branch 'gpeacock/no_rust' into tran/test-coverage
alextrnnn 623f33a
fix: Release reader from memory and typo
alextrnnn 4753686
fix: Merge conflict
tmathern 8a3b7a2
fix: Reset settings that would cause other test to fail
alextrnnn 9615099
Merge pull request #115 from contentauth/tran/test-coverage
alextrnnn 2906d38
fix: Update authors
tmathern 3c94a62
fix: Replace some tests values to use more modern assertions
tmathern fe1cf52
fix: Change assertion
tmathern 6ec11f5
fix: Remove creative assertions
tmathern 9a336dd
fix: Comment
tmathern a69be49
fix: Refactor path names usage in tests
tmathern 838c97c
fix: Refactor path names usage in tests 2
tmathern 1e9e75d
fix: Added a test case
tmathern 39c937f
fix: Refactor benchmark
tmathern fdd7452
fix: Target PyPi for release isntead of testPyPi
tmathern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| name: Build Wheel | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| python-version: | ||
| required: true | ||
| type: string | ||
| architecture: | ||
| required: false | ||
| type: string | ||
| artifact-name: | ||
| required: true | ||
| type: string | ||
| runs-on: | ||
| required: true | ||
| type: string | ||
| default: 'ubuntu-latest' | ||
| c2pa-version: | ||
| required: true | ||
| type: string | ||
| secrets: | ||
| github-token: | ||
| required: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: read | ||
| actions: read | ||
|
|
||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.github-token }} | ||
| C2PA_VERSION: ${{ inputs.c2pa-version }} | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ inputs.runs-on }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Build Linux wheels | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| # 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 && | ||
| 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_VERSION && | ||
| 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 | ||
| " | ||
|
|
||
| # Verify the wheel was built | ||
| 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 (x64) | ||
| 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 | ||
| Write-Host "Starting artifact download process..." | ||
| Write-Host "C2PA_VERSION: $env:C2PA_VERSION" | ||
|
|
||
| python scripts/download_artifacts.py "$env:C2PA_VERSION" | ||
|
|
||
| Write-Host "Artifacts directory contents:" | ||
| Get-ChildItem -Recurse -Path artifacts | ||
| Write-Host "src/c2pa/libs directory contents:" | ||
| Get-ChildItem -Recurse -Path src/c2pa/libs | ||
|
|
||
| # Build wheel | ||
| python setup.py bdist_wheel --plat-name win_amd64 | ||
|
|
||
| - 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_VERSION | ||
|
|
||
| # 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 | ||
| run: | | ||
| echo "Built wheel:" | ||
| ls -l dist/*.whl | ||
|
|
||
| - name: Upload wheels | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.artifact-name }} | ||
| path: dist | ||
| if-no-files-found: error | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will need to support x86 macos, but it can probably wait for now.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can x86 support using the universal libs? I think so? That build target may be easier to get our hands on.