Skip to content

Commit dc4a811

Browse files
committed
Correctly build extension and package.
- Correctly setup `lib` and `include` dirs with libzim. - Build sdist only on python 3.6 to avoid duplicate file at upload on pypi - Build extension with `rpath==$ORIGIN` to allow wrapper to find embedded `libzim.so` - Copy `libzim.so.6` in libzim directory before creating the wheel to embedded it. - Use the `manylinux_x86_64` name for the platform name. (see https://www.python.org/dev/peps/pep-0513/)
1 parent 2dc2909 commit dc4a811

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ on:
66
- v*
77

88
env:
9-
LIBZIM_RELEASE: libzim_linux-x86_64-6.1.1
10-
LIBZIM_LIBRARY_PATH: lib/x86_64-linux-gnu/libzim.so.6.1.1
9+
LIBZIM_RELEASE: libzim_linux-x86_64-6.1.5
1110
LIBZIM_INCLUDE_PATH: include/zim
1211
CYTHON_VERSION: 0.29.6
1312

@@ -46,22 +45,25 @@ jobs:
4645
4746
- name: Link libzim dylib & headers into workspace lib and include folders
4847
run: |
49-
cp -p $GITHUB_WORKSPACE/libzim_linux/$LIBZIM_LIBRARY_PATH lib/libzim.so
50-
cp -p $GITHUB_WORKSPACE/libzim_linux/$LIBZIM_LIBRARY_PATH lib/
51-
sudo ldconfig $GITHUB_WORKSPACE/lib
48+
cp -dp $GITHUB_WORKSPACE/libzim_linux/lib/x86_64-linux-gnu/* lib/
49+
ln -s libzim.so.6 lib/libzim.so
5250
ln -s $GITHUB_WORKSPACE/libzim_linux/$LIBZIM_INCLUDE_PATH include/zim
5351
5452
- name: Build cython, sdist, and bdist_wheels
5553
run: |
56-
pip install --upgrade cython==$CYTHON_VERSION setuptools pip
57-
python3 setup.py build_ext
58-
python3 setup.py sdist bdist_wheel
59-
python -m cibuildwheel --output-dir wheelhouse
54+
pip install --upgrade cython==$CYTHON_VERSION setuptools pip wheel
55+
python3 setup.py build_ext --rpath='$ORIGIN'
56+
if [[ "${{ matrix.python-version }}" == "3.6" ]]
57+
then
58+
python3 setup.py sdist
59+
fi
60+
cp -p lib/libzim.so.6 libzim
61+
python3 setup.py bdist_wheel --plat-name=manylinux1_x86_64
6062
6163
- uses: actions/upload-artifact@v1
6264
with:
6365
name: wheels
64-
path: ./wheelhouse
66+
path: ./dist
6567

6668
- name: Push release to PyPI
6769
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ include README.md
33
include tests/*.py
44
include pyproject.toml
55

6-
recursive-include lib *
7-
recursive-include include *
86
recursive-include libzim *
7+
global-exclude __pycache__/*
8+
exclude *.egg-info/*

0 commit comments

Comments
 (0)