Skip to content

Commit 06401a1

Browse files
Add repair wheel manylinux
1 parent 66480f3 commit 06401a1

File tree

5 files changed

+45
-5
lines changed

5 files changed

+45
-5
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,32 @@ jobs:
172172
push: true
173173
tags: ${{ secrets.DOCKER_USERNAME }}/libgaussianblur:${{ env.BUILD_TARGET }}
174174

175+
- name: Pull manylinux image if not cached
176+
run: |
177+
if [ -f ".docker/.cache-${{ env.BUILD_TARGET }}/manylinux_2_34_x86_64.tar" ]; then
178+
echo "Loading manylinux image from cache..."
179+
docker load < .docker/.cache-${{ env.BUILD_TARGET }}/manylinux_2_34_x86_64.tar
180+
else
181+
echo "Pulling manylinux image..."
182+
docker pull quay.io/pypa/manylinux_2_34_x86_64
183+
echo "Saving manylinux image to cache..."
184+
mkdir -p .docker/.cache-${{ env.BUILD_TARGET }}
185+
docker save quay.io/pypa/manylinux_2_34_x86_64 > .docker/.cache-${{ env.BUILD_TARGET }}/manylinux_2_34_x86_64.tar
186+
fi
187+
188+
- name: Repair Python wheels with auditwheel
189+
run: |
190+
docker run --rm \
191+
-v "$(pwd)/output-${{ env.BUILD_TARGET }}/app/external/${{ env.BUILD_TARGET }}/x86_64/python:/io" \
192+
quay.io/pypa/manylinux_2_34_x86_64 \
193+
bash -c "set -e; \
194+
auditwheel repair /io/*.whl; \
195+
repaired_wheel=\$(ls /wheelhouse/*.whl); \
196+
echo \"Found repaired wheel: \$repaired_wheel\"; \
197+
cp \$repaired_wheel /io/\$(basename \$repaired_wheel); \
198+
chown -R $(id -u):$(id -g) /io/\$(basename \$repaired_wheel); \
199+
echo \"Wheel copied as: /io/\$(basename \$repaired_wheel)\""
200+
175201
- name: Save docker linux if cache miss
176202
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
177203
uses: actions/cache/save@v4

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,30 @@ make
198198

199199
## Usage in Python
200200

201-
If you build the library with `WITH_BINDINGS=ON`, a Python wheel will be generated. You will find the wheel under `external/PLATFORM/ABI/python/` along with the shared library.
201+
If you build the library with `WITH_BINDINGS=ON`, a Python wheel will be generated. You will find the wheel under `external/PLATFORM/ABI/python/` along with the shared library.
202+
203+
Alternatively, you can install the library directly from [PyPI](https://pypi.org/project/gaussianblur/):
204+
205+
```sh
206+
pip install gaussianblur
207+
```
208+
202209

203210
A basic example has been provided about how to use the module.
204211
First, install the wheel with pip, and then, replace with your input/output image paths:
205212

206213
```sh
207-
pip3 install gaussianblur*.whl
214+
pip install gaussianblur*.whl
208215
python3 examples/python/main.py
209216
```
210217

218+
Note: In the GitHub CI/CD pipeline, the Python wheel is audited by pulling the [manylinux](https://github.com/pypa/manylinux) Docker image and running [auditwheel](https://github.com/pypa/auditwheel). This ensures that all required system shared libraries are bundled within the wheel, meeting the latest PyPI requirements for cross-distribution compatibility on Linux.
219+
At present, this auditing process is implemented **only** for Linux, as it is the primary platform where bindings are built in the CI/CD pipeline.
220+
221+
If you wish to perform this process locally on macOS, you can use [delocate](https://github.com/matthew-brett/delocate) to audit and repair the wheel.
222+
223+
In the future, I may also consider integrating [cibuildwheel](https://github.com/pypa/cibuildwheel) into the pipeline to streamline the process across multiple platforms, but this is currently a secondary priority.
224+
211225
## Usage in C++
212226

213227
When building with `WITH_EXAMPLES=ON`, you can try the library. These examples are intended to provide a simple idea of how the library is used.

bootstrap/bootstrap.gaussianblur.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
PREFIX="gaussian_blur"
77
TEMP_EXTERNAL_BUILD_DIR=.deps
8-
GAUSSIANBLUR_VERSION="1.1.1"
8+
GAUSSIANBLUR_VERSION="1.1.2"
99
GAUSSIANBLUR_FOLDER="v${GAUSSIANBLUR_VERSION}"
1010
GAUSSIANBLUR_BUILD_DIR="${PREFIX}-${GAUSSIANBLUR_FOLDER}"
1111

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "gaussianblur"
7-
version = "1.1.1"
7+
version = "1.1.2"
88
authors = [
99
{ name="Michele Renzullo", email="[email protected]" },
1010
]

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
try:
1515
setup(
1616
name='gaussianblur',
17-
version='1.1.1',
17+
version='1.1.2',
1818
packages=find_packages(),
1919
package_data={'gaussianblur': [
2020
'gaussianblur.cpython*.so',

0 commit comments

Comments
 (0)