Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
- run: |
sudo apt-get install -y python3 python3-setuptools python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install cython
python3 -m pip install cython wheel build installer
# Add cython to the path
echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash
Expand Down
20 changes: 15 additions & 5 deletions src/python/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ PY_BUILD_1 = ${PY_DISTUTILS} build
PY_BUILD_ = ${PY_BUILD_0}
PY_BUILD = ${PY_BUILD_@AM_V@}

PY_INSTALL = ${PY_DISTUTILS} install
# Build a wheel via PEP 517 (python -m build --no-isolation) to avoid the
# deprecated "setup.py install" invocation. The --no-isolation flag reuses
# the in-tree build environment rather than creating an isolated venv.
PY_BDIST_WHEEL = \
VERSION_RELEASE="@PACKAGE_VERSION@" \
CPPFLAGS="-I\${top_srcdir}/include ${AM_CPPFLAGS} ${CPPFLAGS}" \
CFLAGS="${AM_CFLAGS} ${CFLAGS}" \
LDFLAGS="${AM_LDFLAGS} ${LDFLAGS}" \
${PYTHON} -m build --wheel --no-isolation

EXTRA_DIST = libseccomp.pxd seccomp.pyx setup.py

Expand All @@ -40,12 +48,14 @@ build: ../libseccomp.la libseccomp.pxd seccomp.pyx setup.py
${PY_BUILD} && touch build

install-exec-local: build
${PY_INSTALL} --install-lib=${DESTDIR}/${pyexecdir} \
--record=${DESTDIR}/${pyexecdir}/install_files.txt
${PY_BDIST_WHEEL}
${PYTHON} -m installer \
--destdir=${DESTDIR}/ \
--prefix=${prefix} \
dist/seccomp-*.whl

uninstall-local:
cat ${DESTDIR}/${pyexecdir}/install_files.txt | xargs ${RM} -f
${RM} -f ${DESTDIR}/${pyexecdir}/install_files.txt
${PYTHON} -m pip uninstall --yes seccomp

clean-local:
[ ${srcdir} = ${builddir} ] || ${RM} -f ${builddir}/seccomp.pyx
Expand Down