From 25957de017371f1e4d5978186ee64f0e60282059 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Fri, 22 Mar 2024 15:53:41 +0200 Subject: [PATCH] direct call of setup.py is deprecated --- .gitignore | 3 ++- Makefile | 2 +- pkg/arch/PKGBUILD | 2 +- python/MANIFEST.in | 2 ++ python/Makefile | 8 +++++--- python/setup.py | 1 - 6 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 python/MANIFEST.in diff --git a/.gitignore b/.gitignore index 4a0d6d1c6..52e3ffe8a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,9 @@ /pkg/arch/pkg/ /pkg/arch/src/ /src/build/ -/python/build/ +/python/dist/ /python/ustreamer.egg-info/ +/python/root/ /janus/build/ /ustreamer /ustreamer-* diff --git a/Makefile b/Makefile index bcf6897f8..59dbf921f 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ apps: python: $(MAKE) -C python - $(ECHO) ln -sf python/build/lib.*/*.so . + $(ECHO) ln -sf python/root/usr/lib/python*/site-packages/*.so . janus: diff --git a/pkg/arch/PKGBUILD b/pkg/arch/PKGBUILD index a6588c786..d2b4252c1 100644 --- a/pkg/arch/PKGBUILD +++ b/pkg/arch/PKGBUILD @@ -19,7 +19,7 @@ _options="WITH_GPIO=1 WITH_SYSTEMD=1" if [ -e /usr/bin/python3 ]; then _options="$_options WITH_PYTHON=1" depends+=(python) - makedepends+=(python-setuptools) + makedepends+=(python-setuptools python-pip python-build) fi if [ -e /usr/include/janus/plugins/plugin.h ];then depends+=(janus-gateway alsa-lib opus) diff --git a/python/MANIFEST.in b/python/MANIFEST.in new file mode 100644 index 000000000..98f6d1253 --- /dev/null +++ b/python/MANIFEST.in @@ -0,0 +1,2 @@ +include setup.py +recursive-include src *.c *h diff --git a/python/Makefile b/python/Makefile index 75c25299f..5082334d7 100644 --- a/python/Makefile +++ b/python/Makefile @@ -9,12 +9,14 @@ PY ?= python3 # ===== all: $(info == PY_BUILD ustreamer-*.so) - $(ECHO) $(PY) setup.py build + rm -rf root + $(ECHO) $(PY) -m build --skip-dependency-check --no-isolation + $(ECHO) $(PY) -m pip install dist/*.whl --ignore-installed --root=./root install: - $(PY) setup.py install --prefix=$(PREFIX) --root=$(if $(R_DESTDIR),$(R_DESTDIR),/) + $(PY) -m pip install dist/*.whl --ignore-installed --prefix=$(PREFIX) --root=$(if $(R_DESTDIR),$(R_DESTDIR),/) clean: - rm -rf build ustreamer.egg-info + rm -rf root dist ustreamer.egg-info diff --git a/python/setup.py b/python/setup.py index d0851004f..6d557a982 100644 --- a/python/setup.py +++ b/python/setup.py @@ -29,7 +29,6 @@ def _find_sources(suffix: str) -> list[str]: extra_compile_args=["-std=c17", "-D_GNU_SOURCE"], undef_macros=["NDEBUG"], sources=_find_sources(".c"), - depends=_find_sources(".h"), ), ], )