* [Buildroot] [PATCH v6 1/5] package/python-poetry-core: new host package
@ 2023-11-26 18:08 James Hilliard
2023-11-26 18:08 ` [Buildroot] [PATCH v6 2/5] package/python-terminaltables: use correct pep517 build backend James Hilliard
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: James Hilliard @ 2023-11-26 18:08 UTC (permalink / raw)
To: buildroot
Cc: Gustavo Heinz, Angelo Compagnucci, Asaf Kahlon,
Wojciech M . Zabolotny, James Hilliard, Thomas Petazzoni,
Giulio Benetti
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes v1 -> v2:
- update to 1.7.0
- drop patch which is now upstream
---
package/python-poetry-core/python-poetry-core.hash | 5 +++++
package/python-poetry-core/python-poetry-core.mk | 14 ++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 package/python-poetry-core/python-poetry-core.hash
create mode 100644 package/python-poetry-core/python-poetry-core.mk
diff --git a/package/python-poetry-core/python-poetry-core.hash b/package/python-poetry-core/python-poetry-core.hash
new file mode 100644
index 0000000000..c6b180c852
--- /dev/null
+++ b/package/python-poetry-core/python-poetry-core.hash
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/poetry-core/json
+md5 7461547cac0e0e9c8cd7463aa87e7470 poetry_core-1.7.0.tar.gz
+sha256 8f679b83bd9c820082637beca1204124d5d2a786e4818da47ec8acefd0353b74 poetry_core-1.7.0.tar.gz
+# Locally computed sha256 checksums
+sha256 f1978133782b90f4733bc308ddb19267c3fe04797c88d9ed3bc219032495a982 LICENSE
diff --git a/package/python-poetry-core/python-poetry-core.mk b/package/python-poetry-core/python-poetry-core.mk
new file mode 100644
index 0000000000..4ca587b11d
--- /dev/null
+++ b/package/python-poetry-core/python-poetry-core.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-poetry-core
+#
+################################################################################
+
+PYTHON_POETRY_CORE_VERSION = 1.7.0
+PYTHON_POETRY_CORE_SOURCE = poetry_core-$(PYTHON_POETRY_CORE_VERSION).tar.gz
+PYTHON_POETRY_CORE_SITE = https://files.pythonhosted.org/packages/cb/1c/af7f886e723b2dfbaea9b8a739153f227b386dd856cf956f9fd0ed0a502b
+PYTHON_POETRY_CORE_SETUP_TYPE = pep517
+PYTHON_POETRY_CORE_LICENSE = MIT
+PYTHON_POETRY_CORE_LICENSE_FILES = LICENSE
+
+$(eval $(host-python-package))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 14+ messages in thread* [Buildroot] [PATCH v6 2/5] package/python-terminaltables: use correct pep517 build backend 2023-11-26 18:08 [Buildroot] [PATCH v6 1/5] package/python-poetry-core: new host package James Hilliard @ 2023-11-26 18:08 ` James Hilliard 2023-11-26 18:08 ` [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency James Hilliard ` (2 subsequent siblings) 3 siblings, 0 replies; 14+ messages in thread From: James Hilliard @ 2023-11-26 18:08 UTC (permalink / raw) To: buildroot Cc: Gustavo Heinz, Angelo Compagnucci, Asaf Kahlon, Wojciech M . Zabolotny, James Hilliard, Thomas Petazzoni, Giulio Benetti We need to migrate python-terminaltables to the pep517 poetry-core backend as setuptools is not supported when building with a pep517 frontend. This package currently builds using setuptools as we do not yet use setuptools with a pep517 build frontend. The package contains a setuptools fallback which only can be used when using setuptools without a pep517 frontend as the pep517 frontend will only use the build backend specified in the package pyproject.toml which is poetry-core and not setuptools. Upstream has merged a patch replacing poetry with poetry-core, however we can not backport this using a patch file due to CRLF line ending issues so we will have to apply the change in the patch using sed instead. See upstream commit: https://github.com/matthewdeanmartin/terminaltables/commit/9e3dda0efb54fee6934c744a13a7336d24c6e9e9 Signed-off-by: James Hilliard <james.hilliard1@gmail.com> --- Changes v1 -> v2: - add more details regarding pep517 frontend compatibility --- package/python-terminaltables/python-terminaltables.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/python-terminaltables/python-terminaltables.mk b/package/python-terminaltables/python-terminaltables.mk index b31ed332b6..385c71ae2d 100644 --- a/package/python-terminaltables/python-terminaltables.mk +++ b/package/python-terminaltables/python-terminaltables.mk @@ -7,8 +7,16 @@ PYTHON_TERMINALTABLES_VERSION = 3.1.10 PYTHON_TERMINALTABLES_SOURCE = terminaltables-$(PYTHON_TERMINALTABLES_VERSION).tar.gz PYTHON_TERMINALTABLES_SITE = https://files.pythonhosted.org/packages/f5/fc/0b73d782f5ab7feba8d007573a3773c58255f223c5940a7b7085f02153c3 -PYTHON_TERMINALTABLES_SETUP_TYPE = setuptools +PYTHON_TERMINALTABLES_SETUP_TYPE = pep517 PYTHON_TERMINALTABLES_LICENSE = MIT PYTHON_TERMINALTABLES_LICENSE_FILES = LICENSE +PYTHON_TERMINALTABLES_DEPENDENCIES = host-python-poetry-core + +# we can't use a normal patch file due to different line endings +define PYTHON_TERMINALTABLES_USE_POETRY_CORE + $(SED) 's/requires = \["poetry>=0.12"\]/requires = \["poetry-core>=1.0.0"\]/' $(@D)/pyproject.toml + $(SED) 's/build-backend = "poetry.masonry.api"/build-backend = "poetry.core.masonry.api"/' $(@D)/pyproject.toml +endef +PYTHON_TERMINALTABLES_POST_PATCH_HOOKS += PYTHON_TERMINALTABLES_USE_POETRY_CORE $(eval $(python-package)) -- 2.34.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency 2023-11-26 18:08 [Buildroot] [PATCH v6 1/5] package/python-poetry-core: new host package James Hilliard 2023-11-26 18:08 ` [Buildroot] [PATCH v6 2/5] package/python-terminaltables: use correct pep517 build backend James Hilliard @ 2023-11-26 18:08 ` James Hilliard 2024-02-07 10:16 ` Marcus Hoffmann via buildroot 2024-02-12 0:10 ` Marcus Hoffmann via buildroot 2023-11-26 18:08 ` [Buildroot] [PATCH v6 4/5] package/python-setuptools-rust: add host setuptools-scm dependency James Hilliard 2023-11-26 18:08 ` [Buildroot] [PATCH v6 5/5] package/pkg-python.mk: migrate setuptools to pep517 James Hilliard 3 siblings, 2 replies; 14+ messages in thread From: James Hilliard @ 2023-11-26 18:08 UTC (permalink / raw) To: buildroot Cc: Gustavo Heinz, Angelo Compagnucci, Asaf Kahlon, Wojciech M . Zabolotny, James Hilliard, Thomas Petazzoni, Giulio Benetti We need host-python-cython for python-msgpack to build correctly. This is a hard error when using a pep517 frontend. Fixes: * Getting build dependencies for wheel... running egg_info writing msgpack.egg-info/PKG-INFO writing dependency_links to msgpack.egg-info/dependency_links.txt writing top-level names to msgpack.egg-info/top_level.txt reading manifest file 'msgpack.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '*.c' under directory 'msgpack' adding license file 'COPYING' writing manifest file 'msgpack.egg-info/SOURCES.txt' ERROR Missing dependencies: Cython~=0.29.30 Signed-off-by: James Hilliard <james.hilliard1@gmail.com> --- package/python-msgpack/python-msgpack.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/python-msgpack/python-msgpack.mk b/package/python-msgpack/python-msgpack.mk index 061ff5a761..c915b23bf4 100644 --- a/package/python-msgpack/python-msgpack.mk +++ b/package/python-msgpack/python-msgpack.mk @@ -10,5 +10,6 @@ PYTHON_MSGPACK_SITE = https://files.pythonhosted.org/packages/c2/d5/5662032db157 PYTHON_MSGPACK_LICENSE = Apache-2.0 PYTHON_MSGPACK_LICENSE_FILES = COPYING PYTHON_MSGPACK_SETUP_TYPE = setuptools +PYTHON_MSGPACK_DEPENDENCIES = host-python-cython $(eval $(python-package)) -- 2.34.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency 2023-11-26 18:08 ` [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency James Hilliard @ 2024-02-07 10:16 ` Marcus Hoffmann via buildroot 2024-02-07 10:17 ` Marcus Hoffmann via buildroot 2024-02-07 10:20 ` Thomas Petazzoni via buildroot 2024-02-12 0:10 ` Marcus Hoffmann via buildroot 1 sibling, 2 replies; 14+ messages in thread From: Marcus Hoffmann via buildroot @ 2024-02-07 10:16 UTC (permalink / raw) To: James Hilliard, buildroot Cc: Gustavo Heinz, Asaf Kahlon, Wojciech M . Zabolotny, Angelo Compagnucci, Thomas Petazzoni, Giulio Benetti Hi James, On 26.11.23 19:08, James Hilliard wrote: > We need host-python-cython for python-msgpack to build correctly. > This is a hard error when using a pep517 frontend. > > Fixes: > * Getting build dependencies for wheel... > running egg_info > writing msgpack.egg-info/PKG-INFO > writing dependency_links to msgpack.egg-info/dependency_links.txt > writing top-level names to msgpack.egg-info/top_level.txt > reading manifest file 'msgpack.egg-info/SOURCES.txt' > reading manifest template 'MANIFEST.in' > warning: no files found matching '*.c' under directory 'msgpack' > adding license file 'COPYING' > writing manifest file 'msgpack.egg-info/SOURCES.txt' > > ERROR Missing dependencies: > Cython~=0.29.30 > Unfortunately msgpack 1.0.7 which buildroot has now requires cython ~3.0 [1], which we don't have yet. cython 3.0 and cython 0.29.x (which uvloop still uses) also seem to be still developed in parallel. So maybe we need both as build host packages? Or do you see another solution? Marcus > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> > --- > package/python-msgpack/python-msgpack.mk | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/package/python-msgpack/python-msgpack.mk b/package/python-msgpack/python-msgpack.mk > index 061ff5a761..c915b23bf4 100644 > --- a/package/python-msgpack/python-msgpack.mk > +++ b/package/python-msgpack/python-msgpack.mk > @@ -10,5 +10,6 @@ PYTHON_MSGPACK_SITE = https://files.pythonhosted.org/packages/c2/d5/5662032db157 > PYTHON_MSGPACK_LICENSE = Apache-2.0 > PYTHON_MSGPACK_LICENSE_FILES = COPYING > PYTHON_MSGPACK_SETUP_TYPE = setuptools > +PYTHON_MSGPACK_DEPENDENCIES = host-python-cython > > $(eval $(python-package)) _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency 2024-02-07 10:16 ` Marcus Hoffmann via buildroot @ 2024-02-07 10:17 ` Marcus Hoffmann via buildroot 2024-02-07 10:20 ` Thomas Petazzoni via buildroot 1 sibling, 0 replies; 14+ messages in thread From: Marcus Hoffmann via buildroot @ 2024-02-07 10:17 UTC (permalink / raw) To: James Hilliard, buildroot Cc: Gustavo Heinz, Asaf Kahlon, Wojciech M . Zabolotny, Angelo Compagnucci, Thomas Petazzoni, Giulio Benetti Forgot the reference link... On 07.02.24 11:16, Marcus Hoffmann via buildroot wrote: > Hi James, > > On 26.11.23 19:08, James Hilliard wrote: >> We need host-python-cython for python-msgpack to build correctly. >> This is a hard error when using a pep517 frontend. >> >> Fixes: >> * Getting build dependencies for wheel... >> running egg_info >> writing msgpack.egg-info/PKG-INFO >> writing dependency_links to msgpack.egg-info/dependency_links.txt >> writing top-level names to msgpack.egg-info/top_level.txt >> reading manifest file 'msgpack.egg-info/SOURCES.txt' >> reading manifest template 'MANIFEST.in' >> warning: no files found matching '*.c' under directory 'msgpack' >> adding license file 'COPYING' >> writing manifest file 'msgpack.egg-info/SOURCES.txt' >> >> ERROR Missing dependencies: >> Cython~=0.29.30 >> > > Unfortunately msgpack 1.0.7 which buildroot has now requires cython ~3.0 > [1], which we don't have yet. cython 3.0 and cython 0.29.x (which uvloop > still uses) also seem to be still developed in parallel. So maybe we > need both as build host packages? Or do you see another solution? > > Marcus [1] https://github.com/msgpack/msgpack-python/blob/v1.0.7/pyproject.toml#L5 > >> Signed-off-by: James Hilliard <james.hilliard1@gmail.com> >> --- >> package/python-msgpack/python-msgpack.mk | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/package/python-msgpack/python-msgpack.mk >> b/package/python-msgpack/python-msgpack.mk >> index 061ff5a761..c915b23bf4 100644 >> --- a/package/python-msgpack/python-msgpack.mk >> +++ b/package/python-msgpack/python-msgpack.mk >> @@ -10,5 +10,6 @@ PYTHON_MSGPACK_SITE = >> https://files.pythonhosted.org/packages/c2/d5/5662032db157 >> PYTHON_MSGPACK_LICENSE = Apache-2.0 >> PYTHON_MSGPACK_LICENSE_FILES = COPYING >> PYTHON_MSGPACK_SETUP_TYPE = setuptools >> +PYTHON_MSGPACK_DEPENDENCIES = host-python-cython >> $(eval $(python-package)) > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency 2024-02-07 10:16 ` Marcus Hoffmann via buildroot 2024-02-07 10:17 ` Marcus Hoffmann via buildroot @ 2024-02-07 10:20 ` Thomas Petazzoni via buildroot 2024-02-07 17:39 ` Marcus Hoffmann via buildroot 2024-02-07 19:56 ` James Hilliard 1 sibling, 2 replies; 14+ messages in thread From: Thomas Petazzoni via buildroot @ 2024-02-07 10:20 UTC (permalink / raw) To: Marcus Hoffmann Cc: Gustavo Heinz, Angelo Compagnucci, Asaf Kahlon, Wojciech M . Zabolotny, James Hilliard, buildroot, Giulio Benetti On Wed, 7 Feb 2024 11:16:27 +0100 Marcus Hoffmann <buildroot@bubu1.eu> wrote: > Unfortunately msgpack 1.0.7 which buildroot has now requires cython ~3.0 > [1], which we don't have yet. cython 3.0 and cython 0.29.x (which uvloop > still uses) also seem to be still developed in parallel. So maybe we > need both as build host packages? Or do you see another solution? If we were to have both in parallel, then the big question is whether it is possible to install them both in parallel without them conflicting with each other. Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency 2024-02-07 10:20 ` Thomas Petazzoni via buildroot @ 2024-02-07 17:39 ` Marcus Hoffmann via buildroot 2024-02-07 19:56 ` James Hilliard 1 sibling, 0 replies; 14+ messages in thread From: Marcus Hoffmann via buildroot @ 2024-02-07 17:39 UTC (permalink / raw) To: Thomas Petazzoni Cc: Gustavo Heinz, James Hilliard, Asaf Kahlon, Wojciech M . Zabolotny, Angelo Compagnucci, buildroot, Giulio Benetti On 07.02.24 11:20, Thomas Petazzoni via buildroot wrote: > On Wed, 7 Feb 2024 11:16:27 +0100 > Marcus Hoffmann <buildroot@bubu1.eu> wrote: > >> Unfortunately msgpack 1.0.7 which buildroot has now requires cython ~3.0 >> [1], which we don't have yet. cython 3.0 and cython 0.29.x (which uvloop >> still uses) also seem to be still developed in parallel. So maybe we >> need both as build host packages? Or do you see another solution? > > If we were to have both in parallel, then the big question is whether > it is possible to install them both in parallel without them > conflicting with each other. They would conflict and there's no easy way to avoid that AFAIK. I think the best path forward is upgrading to cython 3.0 and passing the language_level=2 compatibility option[1], which seems to restore the 0.29.x behavior? I've yet to understand how to pass this option for a pep517 build though. uvloop at least also has a pending MR to support cython 3 directly [2] but we have a bunch of other packages depending on cython. [1] https://cython.readthedocs.io/en/stable/src/userguide/migrating_to_cy30.html#python-3-syntax-semantics [2] https://github.com/MagicStack/uvloop/pull/587/files > > Thomas _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency 2024-02-07 10:20 ` Thomas Petazzoni via buildroot 2024-02-07 17:39 ` Marcus Hoffmann via buildroot @ 2024-02-07 19:56 ` James Hilliard 2024-02-09 17:59 ` James Hilliard 1 sibling, 1 reply; 14+ messages in thread From: James Hilliard @ 2024-02-07 19:56 UTC (permalink / raw) To: Thomas Petazzoni Cc: Gustavo Heinz, Asaf Kahlon, Wojciech M . Zabolotny, Angelo Compagnucci, Marcus Hoffmann, buildroot, Giulio Benetti On Wed, Feb 7, 2024 at 3:21 AM Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote: > > On Wed, 7 Feb 2024 11:16:27 +0100 > Marcus Hoffmann <buildroot@bubu1.eu> wrote: > > > Unfortunately msgpack 1.0.7 which buildroot has now requires cython ~3.0 > > [1], which we don't have yet. cython 3.0 and cython 0.29.x (which uvloop > > still uses) also seem to be still developed in parallel. So maybe we > > need both as build host packages? Or do you see another solution? That's annoying, maybe the easiest option is to downgrade msgpack for now until everything supports cython 3.0? > > If we were to have both in parallel, then the big question is whether > it is possible to install them both in parallel without them > conflicting with each other. Seems tricky. > > Thomas > -- > Thomas Petazzoni, co-owner and CEO, Bootlin > Embedded Linux and Kernel engineering and training > https://bootlin.com _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency 2024-02-07 19:56 ` James Hilliard @ 2024-02-09 17:59 ` James Hilliard 0 siblings, 0 replies; 14+ messages in thread From: James Hilliard @ 2024-02-09 17:59 UTC (permalink / raw) To: Thomas Petazzoni Cc: Gustavo Heinz, Asaf Kahlon, Wojciech M . Zabolotny, Angelo Compagnucci, Marcus Hoffmann, buildroot, Giulio Benetti On Wed, Feb 7, 2024 at 12:56 PM James Hilliard <james.hilliard1@gmail.com> wrote: > > On Wed, Feb 7, 2024 at 3:21 AM Thomas Petazzoni > <thomas.petazzoni@bootlin.com> wrote: > > > > On Wed, 7 Feb 2024 11:16:27 +0100 > > Marcus Hoffmann <buildroot@bubu1.eu> wrote: > > > > > Unfortunately msgpack 1.0.7 which buildroot has now requires cython ~3.0 > > > [1], which we don't have yet. cython 3.0 and cython 0.29.x (which uvloop > > > still uses) also seem to be still developed in parallel. So maybe we > > > need both as build host packages? Or do you see another solution? > > That's annoying, maybe the easiest option is to downgrade msgpack for now > until everything supports cython 3.0? There are patches adding cython 3 support to uvloop(gentoo also uses these), so I've gone ahead and added those and bumped cython to version 3.0: https://patchwork.ozlabs.org/project/buildroot/patch/20240209175631.1337370-1-james.hilliard1@gmail.com/ https://patchwork.ozlabs.org/project/buildroot/patch/20240209175631.1337370-2-james.hilliard1@gmail.com/ > > > > > If we were to have both in parallel, then the big question is whether > > it is possible to install them both in parallel without them > > conflicting with each other. > > Seems tricky. > > > > > Thomas > > -- > > Thomas Petazzoni, co-owner and CEO, Bootlin > > Embedded Linux and Kernel engineering and training > > https://bootlin.com _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency 2023-11-26 18:08 ` [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency James Hilliard 2024-02-07 10:16 ` Marcus Hoffmann via buildroot @ 2024-02-12 0:10 ` Marcus Hoffmann via buildroot 1 sibling, 0 replies; 14+ messages in thread From: Marcus Hoffmann via buildroot @ 2024-02-12 0:10 UTC (permalink / raw) To: James Hilliard, buildroot Cc: Gustavo Heinz, Asaf Kahlon, Wojciech M . Zabolotny, Angelo Compagnucci, Thomas Petazzoni, Giulio Benetti Hi James, I hopefully found an acceptable solution to the cython problem. On 26.11.23 19:08, James Hilliard wrote: > We need host-python-cython for python-msgpack to build correctly. > This is a hard error when using a pep517 frontend. I did some more tests and actually this error comes just from Cython now being mentioned in the pyproject.toml build-system requires section.[1] In practice it is no more or less required than when using the old setup.py method. If the cython generated files are already there (they are usually present in the sdist, and indeed they are for msgpack here), then cython will never be invoked. So something simple like running sed -i -e '/Cython~=3.0.0/d' $(@D)/pyproject.toml inside some pre-build hook (or a patch to similar effect) works around this problem. I think, given the whole mess that the different cython version dependencies are currently causing, relying on the upstream generated files (as we have done before) sounds like the best option. (similarly for uvloop, which behaves just the same regarding the cython dependency). [1] https://github.com/msgpack/msgpack-python/blob/main/pyproject.toml#L5 > > Fixes: > * Getting build dependencies for wheel... > running egg_info > writing msgpack.egg-info/PKG-INFO > writing dependency_links to msgpack.egg-info/dependency_links.txt > writing top-level names to msgpack.egg-info/top_level.txt > reading manifest file 'msgpack.egg-info/SOURCES.txt' > reading manifest template 'MANIFEST.in' > warning: no files found matching '*.c' under directory 'msgpack' > adding license file 'COPYING' > writing manifest file 'msgpack.egg-info/SOURCES.txt' > > ERROR Missing dependencies: > Cython~=0.29.30 > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> > --- > package/python-msgpack/python-msgpack.mk | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/package/python-msgpack/python-msgpack.mk b/package/python-msgpack/python-msgpack.mk > index 061ff5a761..c915b23bf4 100644 > --- a/package/python-msgpack/python-msgpack.mk > +++ b/package/python-msgpack/python-msgpack.mk > @@ -10,5 +10,6 @@ PYTHON_MSGPACK_SITE = https://files.pythonhosted.org/packages/c2/d5/5662032db157 > PYTHON_MSGPACK_LICENSE = Apache-2.0 > PYTHON_MSGPACK_LICENSE_FILES = COPYING > PYTHON_MSGPACK_SETUP_TYPE = setuptools > +PYTHON_MSGPACK_DEPENDENCIES = host-python-cython > > $(eval $(python-package)) Marcus _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v6 4/5] package/python-setuptools-rust: add host setuptools-scm dependency 2023-11-26 18:08 [Buildroot] [PATCH v6 1/5] package/python-poetry-core: new host package James Hilliard 2023-11-26 18:08 ` [Buildroot] [PATCH v6 2/5] package/python-terminaltables: use correct pep517 build backend James Hilliard 2023-11-26 18:08 ` [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency James Hilliard @ 2023-11-26 18:08 ` James Hilliard 2023-11-26 18:08 ` [Buildroot] [PATCH v6 5/5] package/pkg-python.mk: migrate setuptools to pep517 James Hilliard 3 siblings, 0 replies; 14+ messages in thread From: James Hilliard @ 2023-11-26 18:08 UTC (permalink / raw) To: buildroot Cc: Gustavo Heinz, Angelo Compagnucci, Asaf Kahlon, Wojciech M . Zabolotny, James Hilliard, Thomas Petazzoni, Giulio Benetti We need host-python-setuptools-scm for python-setuptools-rust to build correctly when using a pep517 frontend. Fixes: * Getting build dependencies for wheel... running egg_info writing setuptools_rust.egg-info/PKG-INFO writing dependency_links to setuptools_rust.egg-info/dependency_links.txt writing entry points to setuptools_rust.egg-info/entry_points.txt writing requirements to setuptools_rust.egg-info/requires.txt writing top-level names to setuptools_rust.egg-info/top_level.txt reading manifest file 'setuptools_rust.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'setuptools_rust.egg-info/SOURCES.txt' ERROR Missing dependencies: setuptools_scm Signed-off-by: James Hilliard <james.hilliard1@gmail.com> --- package/python-setuptools-rust/python-setuptools-rust.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/python-setuptools-rust/python-setuptools-rust.mk b/package/python-setuptools-rust/python-setuptools-rust.mk index f07263becf..e664a5604f 100644 --- a/package/python-setuptools-rust/python-setuptools-rust.mk +++ b/package/python-setuptools-rust/python-setuptools-rust.mk @@ -10,6 +10,9 @@ PYTHON_SETUPTOOLS_RUST_SITE = https://files.pythonhosted.org/packages/f2/40/f1e9 PYTHON_SETUPTOOLS_RUST_SETUP_TYPE = setuptools PYTHON_SETUPTOOLS_RUST_LICENSE = MIT PYTHON_SETUPTOOLS_RUST_LICENSE_FILES = LICENSE -HOST_PYTHON_SETUPTOOLS_RUST_DEPENDENCIES = host-rustc host-python-semantic-version +HOST_PYTHON_SETUPTOOLS_RUST_DEPENDENCIES = \ + host-rustc \ + host-python-semantic-version \ + host-python-setuptools-scm $(eval $(host-python-package)) -- 2.34.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v6 5/5] package/pkg-python.mk: migrate setuptools to pep517 2023-11-26 18:08 [Buildroot] [PATCH v6 1/5] package/python-poetry-core: new host package James Hilliard ` (2 preceding siblings ...) 2023-11-26 18:08 ` [Buildroot] [PATCH v6 4/5] package/python-setuptools-rust: add host setuptools-scm dependency James Hilliard @ 2023-11-26 18:08 ` James Hilliard 2024-02-06 22:31 ` Marcus Hoffmann via buildroot 3 siblings, 1 reply; 14+ messages in thread From: James Hilliard @ 2023-11-26 18:08 UTC (permalink / raw) To: buildroot Cc: Gustavo Heinz, Angelo Compagnucci, Asaf Kahlon, Wojciech M . Zabolotny, James Hilliard, Thomas Petazzoni, Giulio Benetti Now that setuptools and its dependencies are using pep517 we can migrate the setuptools infrastructure itself to use the pep517 build frontend. As part of this we need to migrate the all python packages using _BUILD_OPTS to the new config settings format used by the pep517 build frontend. Use new setup type variables to define setup type specific dependencies instead of using the conditional block. Signed-off-by: James Hilliard <james.hilliard1@gmail.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> --- Changes v5 -> v6: - use setup type variables for dependencies Changes v4 -> v5: - rebase on next Changes v1 -> v3: - rebase on master - combine setuptools-rust and maturin env variables - drop patch which is now upstream --- package/pkg-python.mk | 160 ++++++++++----------- package/python-evdev/python-evdev.mk | 4 +- package/python-lxml/python-lxml.mk | 8 +- package/python-m2crypto/python-m2crypto.mk | 4 +- package/python-pillow/python-pillow.mk | 35 +++-- package/python-psycopg2/python-psycopg2.mk | 5 +- package/python-pyzmq/python-pyzmq.mk | 4 +- package/python-uvloop/python-uvloop.mk | 6 +- 8 files changed, 113 insertions(+), 113 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index bda79116c8..cb9f6ab5e6 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -86,15 +86,62 @@ HOST_PKG_PYTHON_DISTUTILS_INSTALL_CMD = \ setup.py install \ --prefix=$(HOST_DIR) -# Target setuptools-based packages -PKG_PYTHON_SETUPTOOLS_ENV = \ +# Target pep517-based packages +PKG_PYTHON_PEP517_ENV = \ $(PKG_PYTHON_ENV) -PKG_PYTHON_SETUPTOOLS_CMD = \ - $(if $(wildcard $($(PKG)_BUILDDIR)/setup.py),setup.py,-c 'from setuptools import setup;setup()') +PKG_PYTHON_PEP517_BUILD_CMD = \ + -m build -n -w + +PKG_PYTHON_PEP517_INSTALL_OPTS = \ + --interpreter=/usr/bin/python \ + --script-kind=posix + +PKG_PYTHON_PEP517_INSTALL_TARGET_CMD = \ + $(TOPDIR)/support/scripts/pyinstaller.py \ + dist/* \ + $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ + --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ + --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ + --scripts=$(TARGET_DIR)/usr/bin \ + --data=$(TARGET_DIR)/usr + +PKG_PYTHON_PEP517_INSTALL_STAGING_CMD = \ + $(TOPDIR)/support/scripts/pyinstaller.py \ + dist/* \ + $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ + --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ + --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ + --scripts=$(STAGING_DIR)/usr/bin \ + --data=$(STAGING_DIR)/usr + +PKG_PYTHON_PEP517_DEPENDENCIES = \ + host-python-pypa-build \ + host-python-installer + +# Host pep517-based packages +HOST_PKG_PYTHON_PEP517_ENV = \ + $(HOST_PKG_PYTHON_ENV) + +HOST_PKG_PYTHON_PEP517_BUILD_CMD = \ + -m build -n -w + +HOST_PKG_PYTHON_PEP517_INSTALL_CMD = \ + $(TOPDIR)/support/scripts/pyinstaller.py \ + dist/* \ + --interpreter=$(HOST_DIR)/bin/python \ + --script-kind=posix \ + --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ + --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR) \ + --scripts=$(HOST_DIR)/bin \ + --data=$(HOST_DIR) + +# Target setuptools-based packages +PKG_PYTHON_SETUPTOOLS_ENV = \ + $(PKG_PYTHON_PEP517_ENV) PKG_PYTHON_SETUPTOOLS_BUILD_CMD = \ - $(PKG_PYTHON_SETUPTOOLS_CMD) build + $(PKG_PYTHON_PEP517_BUILD_CMD) PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \ --install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \ @@ -103,30 +150,24 @@ PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \ --single-version-externally-managed PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_CMD = \ - $(PKG_PYTHON_SETUPTOOLS_CMD) \ - install --no-compile \ - $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) \ - --root=$(TARGET_DIR) + $(PKG_PYTHON_PEP517_INSTALL_TARGET_CMD) PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_CMD = \ - $(PKG_PYTHON_SETUPTOOLS_CMD) \ - install \ - $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) \ - --root=$(STAGING_DIR) + $(PKG_PYTHON_PEP517_INSTALL_STAGING_CMD) + +PKG_PYTHON_SETUPTOOLS_DEPENDENCIES = \ + $(PKG_PYTHON_PEP517_DEPENDENCIES) \ + host-python-setuptools # Host setuptools-based packages HOST_PKG_PYTHON_SETUPTOOLS_ENV = \ - $(HOST_PKG_PYTHON_ENV) + $(HOST_PKG_PYTHON_PEP517_ENV) HOST_PKG_PYTHON_SETUPTOOLS_BUILD_CMD = \ - $(PKG_PYTHON_SETUPTOOLS_CMD) build + $(HOST_PKG_PYTHON_PEP517_BUILD_CMD) HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_CMD = \ - $(PKG_PYTHON_SETUPTOOLS_CMD) \ - install \ - --prefix=$(HOST_DIR) \ - --root=/ \ - --single-version-externally-managed + $(HOST_PKG_PYTHON_PEP517_INSTALL_CMD) # Target setuptools-rust-based packages PKG_PYTHON_SETUPTOOLS_RUST_ENV = \ @@ -143,6 +184,10 @@ PKG_PYTHON_SETUPTOOLS_RUST_INSTALL_TARGET_CMD = \ PKG_PYTHON_SETUPTOOLS_RUST_INSTALL_STAGING_CMD = \ $(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_CMD) +PKG_PYTHON_SETUPTOOLS_RUST_DEPENDENCIES = \ + $(PKG_PYTHON_SETUPTOOLS_DEPENDENCIES) \ + host-python-setuptools-rust + # Host setuptools-rust-based packages HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV = \ $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \ @@ -155,52 +200,6 @@ HOST_PKG_PYTHON_SETUPTOOLS_RUST_BUILD_CMD = \ HOST_PKG_PYTHON_SETUPTOOLS_RUST_INSTALL_CMD = \ $(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_CMD) -# Target pep517-based packages -PKG_PYTHON_PEP517_ENV = \ - $(PKG_PYTHON_ENV) - -PKG_PYTHON_PEP517_BUILD_CMD = \ - -m build -n -w - -PKG_PYTHON_PEP517_INSTALL_OPTS = \ - --interpreter=/usr/bin/python \ - --script-kind=posix - -PKG_PYTHON_PEP517_INSTALL_TARGET_CMD = \ - $(TOPDIR)/support/scripts/pyinstaller.py \ - dist/* \ - $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ - --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ - --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ - --scripts=$(TARGET_DIR)/usr/bin \ - --data=$(TARGET_DIR)/usr - -PKG_PYTHON_PEP517_INSTALL_STAGING_CMD = \ - $(TOPDIR)/support/scripts/pyinstaller.py \ - dist/* \ - $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ - --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ - --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ - --scripts=$(STAGING_DIR)/usr/bin \ - --data=$(STAGING_DIR)/usr - -# Host pep517-based packages -HOST_PKG_PYTHON_PEP517_ENV = \ - $(HOST_PKG_PYTHON_ENV) - -HOST_PKG_PYTHON_PEP517_BUILD_CMD = \ - -m build -n -w - -HOST_PKG_PYTHON_PEP517_INSTALL_CMD = \ - $(TOPDIR)/support/scripts/pyinstaller.py \ - dist/* \ - --interpreter=$(HOST_DIR)/bin/python \ - --script-kind=posix \ - --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ - --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR) \ - --scripts=$(HOST_DIR)/bin \ - --data=$(HOST_DIR) - # Target flit packages PKG_PYTHON_FLIT_ENV = \ $(PKG_PYTHON_PEP517_ENV) @@ -214,6 +213,10 @@ PKG_PYTHON_FLIT_INSTALL_TARGET_CMD = \ PKG_PYTHON_FLIT_INSTALL_STAGING_CMD = \ $(PKG_PYTHON_PEP517_INSTALL_STAGING_CMD) +PKG_PYTHON_FLIT_DEPENDENCIES = \ + $(PKG_PYTHON_PEP517_DEPENDENCIES) \ + host-python-flit-core + # Host flit packages HOST_PKG_PYTHON_FLIT_ENV = \ $(HOST_PKG_PYTHON_PEP517_ENV) @@ -249,6 +252,10 @@ PKG_PYTHON_MATURIN_INSTALL_TARGET_CMD = \ PKG_PYTHON_MATURIN_INSTALL_STAGING_CMD = \ $(PKG_PYTHON_PEP517_INSTALL_STAGING_CMD) +PKG_PYTHON_MATURIN_DEPENDENCIES = \ + $(PKG_PYTHON_PEP517_DEPENDENCIES) \ + host-python-maturin + # Host maturin packages HOST_PKG_PYTHON_MATURIN_ENV = \ $(HOST_PKG_PYTHON_PEP517_ENV) \ @@ -327,28 +334,17 @@ else $(2)_DEPENDENCIES += host-python3 endif # ($(4),target) -# Setuptools based packages will need setuptools for the host Python -# interpreter (both host and target). +# Setup type specific dependencies are the same whether we are +# building for the host or the target. # -ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),) -$(2)_DEPENDENCIES += host-python-setuptools -ifeq ($$($(2)_SETUP_TYPE),setuptools-rust) -$(2)_DEPENDENCIES += host-python-setuptools-rust -endif -else ifneq ($$(filter flit maturin pep517,$$($(2)_SETUP_TYPE)),) -$(2)_DEPENDENCIES += host-python-pypa-build host-python-installer -ifeq ($$($(2)_SETUP_TYPE),flit) -$(2)_DEPENDENCIES += host-python-flit-core -endif -ifeq ($$($(2)_SETUP_TYPE),maturin) -$(2)_DEPENDENCIES += host-python-maturin -endif -else ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) +ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) # Don't add dependency on host-python-installer for # host-python-installer itself, and its dependencies. ifeq ($$(filter host-python-flit-core host-python-installer,$(1)),) $(2)_DEPENDENCIES += host-python-installer endif +else +$(2)_DEPENDENCIES += $$(PKG_PYTHON_$$($(2)_SETUP_TYPE_UPPER)_DEPENDENCIES) endif # Pyo3 based packages(setuptools-rust and maturin) will need rust diff --git a/package/python-evdev/python-evdev.mk b/package/python-evdev/python-evdev.mk index 5cf62b5160..b509b43e8a 100644 --- a/package/python-evdev/python-evdev.mk +++ b/package/python-evdev/python-evdev.mk @@ -12,7 +12,7 @@ PYTHON_EVDEV_LICENSE = Revised BSD License PYTHON_EVDEV_LICENSE_FILES = LICENSE PYTHON_EVDEV_BUILD_OPTS = \ - build_ecodes \ - --evdev-headers $(STAGING_DIR)/usr/include/linux/input.h:$(STAGING_DIR)/usr/include/linux/input-event-codes.h:$(STAGING_DIR)/usr/include/linux/uinput.h + -C--build-option=build_ecodes \ + -C--build-option=--evdev-headers=$(STAGING_DIR)/usr/include/linux/input.h:$(STAGING_DIR)/usr/include/linux/input-event-codes.h:$(STAGING_DIR)/usr/include/linux/uinput.h $(eval $(python-package)) diff --git a/package/python-lxml/python-lxml.mk b/package/python-lxml/python-lxml.mk index 3ef3aabdbc..4454f5aa0c 100644 --- a/package/python-lxml/python-lxml.mk +++ b/package/python-lxml/python-lxml.mk @@ -28,11 +28,11 @@ HOST_PYTHON_LXML_DEPENDENCIES = host-libxml2 host-libxslt host-zlib # python-lxml needs these scripts in order to properly detect libxml2 and # libxslt compiler and linker flags PYTHON_LXML_BUILD_OPTS = \ - --xslt-config=$(STAGING_DIR)/usr/bin/xslt-config \ - --xml2-config=$(STAGING_DIR)/usr/bin/xml2-config + -C--build-option=--xslt-config=$(STAGING_DIR)/usr/bin/xslt-config \ + -C--build-option=--xml2-config=$(STAGING_DIR)/usr/bin/xml2-config HOST_PYTHON_LXML_BUILD_OPTS = \ - --xslt-config=$(HOST_DIR)/bin/xslt-config \ - --xml2-config=$(HOST_DIR)/bin/xml2-config + -C--build-option=--xslt-config=$(HOST_DIR)/bin/xslt-config \ + -C--build-option=--xml2-config=$(HOST_DIR)/bin/xml2-config $(eval $(python-package)) $(eval $(host-python-package)) diff --git a/package/python-m2crypto/python-m2crypto.mk b/package/python-m2crypto/python-m2crypto.mk index 69a0c28df5..6c07f42d06 100644 --- a/package/python-m2crypto/python-m2crypto.mk +++ b/package/python-m2crypto/python-m2crypto.mk @@ -13,6 +13,8 @@ PYTHON_M2CRYPTO_LICENSE_FILES = LICENCE PYTHON_M2CRYPTO_CPE_ID_VENDOR = m2crypto_project PYTHON_M2CRYPTO_CPE_ID_PRODUCT = m2crypto PYTHON_M2CRYPTO_DEPENDENCIES = openssl host-swig -PYTHON_M2CRYPTO_BUILD_OPTS = --openssl=$(STAGING_DIR)/usr +PYTHON_M2CRYPTO_BUILD_OPTS = \ + -C--build-option=build_ext \ + -C--build-option=--openssl=$(STAGING_DIR)/usr $(eval $(python-package)) diff --git a/package/python-pillow/python-pillow.mk b/package/python-pillow/python-pillow.mk index bc94062da8..e2077654d2 100644 --- a/package/python-pillow/python-pillow.mk +++ b/package/python-pillow/python-pillow.mk @@ -14,61 +14,60 @@ PYTHON_PILLOW_CPE_ID_PRODUCT = pillow PYTHON_PILLOW_SETUP_TYPE = setuptools PYTHON_PILLOW_DEPENDENCIES = host-pkgconf -PYTHON_PILLOW_BUILD_OPTS = build_ext --disable-platform-guessing -PYTHON_PILLOW_INSTALL_TARGET_OPTS = $(PYTHON_PILLOW_BUILD_OPTS) +PYTHON_PILLOW_BUILD_OPTS = -C--build-option=build_ext -C--build-option=--disable-platform-guessing ifeq ($(BR2_PACKAGE_FREETYPE),y) PYTHON_PILLOW_DEPENDENCIES += freetype -PYTHON_PILLOW_BUILD_OPTS += --enable-freetype +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-freetype else -PYTHON_PILLOW_BUILD_OPTS += --disable-freetype +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-freetype endif ifeq ($(BR2_PACKAGE_JPEG),y) PYTHON_PILLOW_DEPENDENCIES += jpeg -PYTHON_PILLOW_BUILD_OPTS += --enable-jpeg +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-jpeg else -PYTHON_PILLOW_BUILD_OPTS += --disable-jpeg +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-jpeg endif ifeq ($(BR2_PACKAGE_LCMS2),y) PYTHON_PILLOW_DEPENDENCIES += lcms2 -PYTHON_PILLOW_BUILD_OPTS += --enable-lcms +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-lcms else -PYTHON_PILLOW_BUILD_OPTS += --disable-lcms +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-lcms endif ifeq ($(BR2_PACKAGE_LIBXCB),y) PYTHON_PILLOW_DEPENDENCIES += libxcb -PYTHON_PILLOW_BUILD_OPTS += --enable-xcb +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-xcb else -PYTHON_PILLOW_BUILD_OPTS += --disable-xcb +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-xcb endif ifeq ($(BR2_PACKAGE_OPENJPEG),y) PYTHON_PILLOW_DEPENDENCIES += openjpeg -PYTHON_PILLOW_BUILD_OPTS += --enable-jpeg2000 +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-jpeg2000 else -PYTHON_PILLOW_BUILD_OPTS += --disable-jpeg2000 +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-jpeg2000 endif ifeq ($(BR2_PACKAGE_TIFF),y) PYTHON_PILLOW_DEPENDENCIES += tiff -PYTHON_PILLOW_BUILD_OPTS += --enable-tiff +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-tiff else -PYTHON_PILLOW_BUILD_OPTS += --disable-tiff +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-tiff endif ifeq ($(BR2_PACKAGE_WEBP),y) PYTHON_PILLOW_DEPENDENCIES += webp -PYTHON_PILLOW_BUILD_OPTS += --enable-webp +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-webp ifeq ($(BR2_PACKAGE_WEBP_DEMUX)$(BR2_PACKAGE_WEBP_MUX),yy) -PYTHON_PILLOW_BUILD_OPTS += --enable-webpmux +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-webpmux else -PYTHON_PILLOW_BUILD_OPTS += --disable-webpmux +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-webpmux endif else -PYTHON_PILLOW_BUILD_OPTS += --disable-webp --disable-webpmux +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-webp -C--build-option=--disable-webpmux endif $(eval $(python-package)) diff --git a/package/python-psycopg2/python-psycopg2.mk b/package/python-psycopg2/python-psycopg2.mk index 0149b8d185..1b33b7505d 100644 --- a/package/python-psycopg2/python-psycopg2.mk +++ b/package/python-psycopg2/python-psycopg2.mk @@ -13,7 +13,8 @@ PYTHON_PSYCOPG2_LICENSE_FILES = LICENSE PYTHON_PSYCOPG2_DEPENDENCIES = postgresql # Force psycopg2 to use the Buildroot provided postgresql version # instead of the one from the host machine -PYTHON_PSYCOPG2_BUILD_OPTS = build_ext --pg-config=$(STAGING_DIR)/usr/bin/pg_config -PYTHON_PSYCOPG2_INSTALL_TARGET_OPTS = build_ext --pg-config=$(STAGING_DIR)/usr/bin/pg_config +PYTHON_PSYCOPG2_BUILD_OPTS = \ + -C--build-option=build_ext \ + -C--build-option=--pg-config=$(STAGING_DIR)/usr/bin/pg_config $(eval $(python-package)) diff --git a/package/python-pyzmq/python-pyzmq.mk b/package/python-pyzmq/python-pyzmq.mk index 5792957eaf..1b7bceae5e 100644 --- a/package/python-pyzmq/python-pyzmq.mk +++ b/package/python-pyzmq/python-pyzmq.mk @@ -12,7 +12,7 @@ PYTHON_PYZMQ_LICENSE = LGPL-3.0+, BSD-3-Clause, Apache-2.0 PYTHON_PYZMQ_LICENSE_FILES = COPYING.LESSER COPYING.BSD PYTHON_PYZMQ_DEPENDENCIES = host-python-packaging zeromq PYTHON_PYZMQ_SETUP_TYPE = setuptools -PYTHON_PYZMQ_BUILD_OPTS = --zmq=$(STAGING_DIR)/usr +PYTHON_PYZMQ_BUILD_OPTS = -C--build-option=--zmq=$(STAGING_DIR)/usr # Due to issues with cross-compiling, hardcode to the zeromq in BR define PYTHON_PYZMQ_PATCH_ZEROMQ_VERSION @@ -23,7 +23,7 @@ endef PYTHON_PYZMQ_POST_PATCH_HOOKS += PYTHON_PYZMQ_PATCH_ZEROMQ_VERSION ifeq ($(BR2_PACKAGE_ZEROMQ_DRAFTS),y) -PYTHON_PYZMQ_BUILD_OPTS += --enable-drafts +PYTHON_PYZMQ_BUILD_OPTS += -C--build-option=--enable-drafts endif $(eval $(python-package)) diff --git a/package/python-uvloop/python-uvloop.mk b/package/python-uvloop/python-uvloop.mk index 285884a2bb..70508fb6de 100644 --- a/package/python-uvloop/python-uvloop.mk +++ b/package/python-uvloop/python-uvloop.mk @@ -10,8 +10,10 @@ PYTHON_UVLOOP_SITE = https://files.pythonhosted.org/packages/9c/16/728cc5dde368e PYTHON_UVLOOP_SETUP_TYPE = setuptools PYTHON_UVLOOP_LICENSE = Apache-2.0, MIT PYTHON_UVLOOP_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT -PYTHON_UVLOOP_BUILD_OPTS = build_ext --inplace --use-system-libuv -PYTHON_UVLOOP_INSTALL_TARGET_OPTS = build_ext --inplace --use-system-libuv PYTHON_UVLOOP_DEPENDENCIES = libuv +PYTHON_UVLOOP_BUILD_OPTS = \ + -C--build-option=build_ext \ + -C--build-option=--inplace \ + -C--build-option=--use-system-libuv $(eval $(python-package)) -- 2.34.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [Buildroot] [PATCH v6 5/5] package/pkg-python.mk: migrate setuptools to pep517 2023-11-26 18:08 ` [Buildroot] [PATCH v6 5/5] package/pkg-python.mk: migrate setuptools to pep517 James Hilliard @ 2024-02-06 22:31 ` Marcus Hoffmann via buildroot 2024-02-07 10:10 ` Marcus Hoffmann via buildroot 0 siblings, 1 reply; 14+ messages in thread From: Marcus Hoffmann via buildroot @ 2024-02-06 22:31 UTC (permalink / raw) To: James Hilliard, buildroot Cc: Gustavo Heinz, Asaf Kahlon, Wojciech M . Zabolotny, Angelo Compagnucci, Thomas Petazzoni, Giulio Benetti Hi James, all On 26.11.23 19:08, James Hilliard wrote: > Now that setuptools and its dependencies are using pep517 we can > migrate the setuptools infrastructure itself to use the pep517 > build frontend. > > As part of this we need to migrate the all python packages using > _BUILD_OPTS to the new config settings format used by the pep517 > build frontend. > > Use new setup type variables to define setup type specific > dependencies instead of using the conditional block. > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> > Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> I tested this with all python packages we use in our project and except for uvloop (see below) it all went well. The patch looks sensible to me as well. Reviewed-by: Marcus Hoffmann <buildroot@bubu1.eu> Tested-by: Marcus Hoffmann <buildroot@bubu1.eu> > --- > Changes v5 -> v6: > - use setup type variables for dependencies > Changes v4 -> v5: > - rebase on next > Changes v1 -> v3: > - rebase on master > - combine setuptools-rust and maturin env variables > - drop patch which is now upstream > --- > package/pkg-python.mk | 160 ++++++++++----------- > package/python-evdev/python-evdev.mk | 4 +- > package/python-lxml/python-lxml.mk | 8 +- > package/python-m2crypto/python-m2crypto.mk | 4 +- > package/python-pillow/python-pillow.mk | 35 +++-- > package/python-psycopg2/python-psycopg2.mk | 5 +- > package/python-pyzmq/python-pyzmq.mk | 4 +- This parts needs a rebase. > package/python-uvloop/python-uvloop.mk | 6 +- > 8 files changed, 113 insertions(+), 113 deletions(-) > > diff --git a/package/pkg-python.mk b/package/pkg-python.mk > index bda79116c8..cb9f6ab5e6 100644 > --- a/package/pkg-python.mk > +++ b/package/pkg-python.mk > @@ -86,15 +86,62 @@ HOST_PKG_PYTHON_DISTUTILS_INSTALL_CMD = \ > setup.py install \ > --prefix=$(HOST_DIR) > > -# Target setuptools-based packages > -PKG_PYTHON_SETUPTOOLS_ENV = \ > +# Target pep517-based packages > +PKG_PYTHON_PEP517_ENV = \ > $(PKG_PYTHON_ENV) > > -PKG_PYTHON_SETUPTOOLS_CMD = \ > - $(if $(wildcard $($(PKG)_BUILDDIR)/setup.py),setup.py,-c 'from setuptools import setup;setup()') > +PKG_PYTHON_PEP517_BUILD_CMD = \ > + -m build -n -w > + > +PKG_PYTHON_PEP517_INSTALL_OPTS = \ > + --interpreter=/usr/bin/python \ > + --script-kind=posix > + > +PKG_PYTHON_PEP517_INSTALL_TARGET_CMD = \ > + $(TOPDIR)/support/scripts/pyinstaller.py \ > + dist/* \ > + $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ > + --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ > + --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ > + --scripts=$(TARGET_DIR)/usr/bin \ > + --data=$(TARGET_DIR)/usr > + > +PKG_PYTHON_PEP517_INSTALL_STAGING_CMD = \ > + $(TOPDIR)/support/scripts/pyinstaller.py \ > + dist/* \ > + $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ > + --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ > + --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ > + --scripts=$(STAGING_DIR)/usr/bin \ > + --data=$(STAGING_DIR)/usr > + > +PKG_PYTHON_PEP517_DEPENDENCIES = \ > + host-python-pypa-build \ > + host-python-installer > + > +# Host pep517-based packages > +HOST_PKG_PYTHON_PEP517_ENV = \ > + $(HOST_PKG_PYTHON_ENV) > + > +HOST_PKG_PYTHON_PEP517_BUILD_CMD = \ > + -m build -n -w > + > +HOST_PKG_PYTHON_PEP517_INSTALL_CMD = \ > + $(TOPDIR)/support/scripts/pyinstaller.py \ > + dist/* \ > + --interpreter=$(HOST_DIR)/bin/python \ > + --script-kind=posix \ > + --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ > + --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR) \ > + --scripts=$(HOST_DIR)/bin \ > + --data=$(HOST_DIR) > + > +# Target setuptools-based packages > +PKG_PYTHON_SETUPTOOLS_ENV = \ > + $(PKG_PYTHON_PEP517_ENV) > > PKG_PYTHON_SETUPTOOLS_BUILD_CMD = \ > - $(PKG_PYTHON_SETUPTOOLS_CMD) build > + $(PKG_PYTHON_PEP517_BUILD_CMD) > > PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \ > --install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \ > @@ -103,30 +150,24 @@ PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \ > --single-version-externally-managed > > PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_CMD = \ > - $(PKG_PYTHON_SETUPTOOLS_CMD) \ > - install --no-compile \ > - $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) \ > - --root=$(TARGET_DIR) > + $(PKG_PYTHON_PEP517_INSTALL_TARGET_CMD) > > PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_CMD = \ > - $(PKG_PYTHON_SETUPTOOLS_CMD) \ > - install \ > - $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) \ > - --root=$(STAGING_DIR) > + $(PKG_PYTHON_PEP517_INSTALL_STAGING_CMD) > + > +PKG_PYTHON_SETUPTOOLS_DEPENDENCIES = \ > + $(PKG_PYTHON_PEP517_DEPENDENCIES) \ > + host-python-setuptools > > # Host setuptools-based packages > HOST_PKG_PYTHON_SETUPTOOLS_ENV = \ > - $(HOST_PKG_PYTHON_ENV) > + $(HOST_PKG_PYTHON_PEP517_ENV) > > HOST_PKG_PYTHON_SETUPTOOLS_BUILD_CMD = \ > - $(PKG_PYTHON_SETUPTOOLS_CMD) build > + $(HOST_PKG_PYTHON_PEP517_BUILD_CMD) > > HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_CMD = \ > - $(PKG_PYTHON_SETUPTOOLS_CMD) \ > - install \ > - --prefix=$(HOST_DIR) \ > - --root=/ \ > - --single-version-externally-managed > + $(HOST_PKG_PYTHON_PEP517_INSTALL_CMD) > > # Target setuptools-rust-based packages > PKG_PYTHON_SETUPTOOLS_RUST_ENV = \ > @@ -143,6 +184,10 @@ PKG_PYTHON_SETUPTOOLS_RUST_INSTALL_TARGET_CMD = \ > PKG_PYTHON_SETUPTOOLS_RUST_INSTALL_STAGING_CMD = \ > $(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_CMD) > > +PKG_PYTHON_SETUPTOOLS_RUST_DEPENDENCIES = \ > + $(PKG_PYTHON_SETUPTOOLS_DEPENDENCIES) \ > + host-python-setuptools-rust > + > # Host setuptools-rust-based packages > HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV = \ > $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \ > @@ -155,52 +200,6 @@ HOST_PKG_PYTHON_SETUPTOOLS_RUST_BUILD_CMD = \ > HOST_PKG_PYTHON_SETUPTOOLS_RUST_INSTALL_CMD = \ > $(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_CMD) > > -# Target pep517-based packages > -PKG_PYTHON_PEP517_ENV = \ > - $(PKG_PYTHON_ENV) > - > -PKG_PYTHON_PEP517_BUILD_CMD = \ > - -m build -n -w > - > -PKG_PYTHON_PEP517_INSTALL_OPTS = \ > - --interpreter=/usr/bin/python \ > - --script-kind=posix > - > -PKG_PYTHON_PEP517_INSTALL_TARGET_CMD = \ > - $(TOPDIR)/support/scripts/pyinstaller.py \ > - dist/* \ > - $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ > - --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ > - --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ > - --scripts=$(TARGET_DIR)/usr/bin \ > - --data=$(TARGET_DIR)/usr > - > -PKG_PYTHON_PEP517_INSTALL_STAGING_CMD = \ > - $(TOPDIR)/support/scripts/pyinstaller.py \ > - dist/* \ > - $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ > - --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ > - --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ > - --scripts=$(STAGING_DIR)/usr/bin \ > - --data=$(STAGING_DIR)/usr > - > -# Host pep517-based packages > -HOST_PKG_PYTHON_PEP517_ENV = \ > - $(HOST_PKG_PYTHON_ENV) > - > -HOST_PKG_PYTHON_PEP517_BUILD_CMD = \ > - -m build -n -w > - > -HOST_PKG_PYTHON_PEP517_INSTALL_CMD = \ > - $(TOPDIR)/support/scripts/pyinstaller.py \ > - dist/* \ > - --interpreter=$(HOST_DIR)/bin/python \ > - --script-kind=posix \ > - --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ > - --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR) \ > - --scripts=$(HOST_DIR)/bin \ > - --data=$(HOST_DIR) > - > # Target flit packages > PKG_PYTHON_FLIT_ENV = \ > $(PKG_PYTHON_PEP517_ENV) > @@ -214,6 +213,10 @@ PKG_PYTHON_FLIT_INSTALL_TARGET_CMD = \ > PKG_PYTHON_FLIT_INSTALL_STAGING_CMD = \ > $(PKG_PYTHON_PEP517_INSTALL_STAGING_CMD) > > +PKG_PYTHON_FLIT_DEPENDENCIES = \ > + $(PKG_PYTHON_PEP517_DEPENDENCIES) \ > + host-python-flit-core > + > # Host flit packages > HOST_PKG_PYTHON_FLIT_ENV = \ > $(HOST_PKG_PYTHON_PEP517_ENV) > @@ -249,6 +252,10 @@ PKG_PYTHON_MATURIN_INSTALL_TARGET_CMD = \ > PKG_PYTHON_MATURIN_INSTALL_STAGING_CMD = \ > $(PKG_PYTHON_PEP517_INSTALL_STAGING_CMD) > > +PKG_PYTHON_MATURIN_DEPENDENCIES = \ > + $(PKG_PYTHON_PEP517_DEPENDENCIES) \ > + host-python-maturin > + > # Host maturin packages > HOST_PKG_PYTHON_MATURIN_ENV = \ > $(HOST_PKG_PYTHON_PEP517_ENV) \ > @@ -327,28 +334,17 @@ else > $(2)_DEPENDENCIES += host-python3 > endif # ($(4),target) > > -# Setuptools based packages will need setuptools for the host Python > -# interpreter (both host and target). > +# Setup type specific dependencies are the same whether we are > +# building for the host or the target. > # > -ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),) > -$(2)_DEPENDENCIES += host-python-setuptools > -ifeq ($$($(2)_SETUP_TYPE),setuptools-rust) > -$(2)_DEPENDENCIES += host-python-setuptools-rust > -endif > -else ifneq ($$(filter flit maturin pep517,$$($(2)_SETUP_TYPE)),) > -$(2)_DEPENDENCIES += host-python-pypa-build host-python-installer > -ifeq ($$($(2)_SETUP_TYPE),flit) > -$(2)_DEPENDENCIES += host-python-flit-core > -endif > -ifeq ($$($(2)_SETUP_TYPE),maturin) > -$(2)_DEPENDENCIES += host-python-maturin > -endif > -else ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) > +ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) > # Don't add dependency on host-python-installer for > # host-python-installer itself, and its dependencies. > ifeq ($$(filter host-python-flit-core host-python-installer,$(1)),) > $(2)_DEPENDENCIES += host-python-installer > endif > +else > +$(2)_DEPENDENCIES += $$(PKG_PYTHON_$$($(2)_SETUP_TYPE_UPPER)_DEPENDENCIES) > endif > > # Pyo3 based packages(setuptools-rust and maturin) will need rust > diff --git a/package/python-evdev/python-evdev.mk b/package/python-evdev/python-evdev.mk > index 5cf62b5160..b509b43e8a 100644 > --- a/package/python-evdev/python-evdev.mk > +++ b/package/python-evdev/python-evdev.mk > @@ -12,7 +12,7 @@ PYTHON_EVDEV_LICENSE = Revised BSD License > PYTHON_EVDEV_LICENSE_FILES = LICENSE > > PYTHON_EVDEV_BUILD_OPTS = \ > - build_ecodes \ > - --evdev-headers $(STAGING_DIR)/usr/include/linux/input.h:$(STAGING_DIR)/usr/include/linux/input-event-codes.h:$(STAGING_DIR)/usr/include/linux/uinput.h > + -C--build-option=build_ecodes \ > + -C--build-option=--evdev-headers=$(STAGING_DIR)/usr/include/linux/input.h:$(STAGING_DIR)/usr/include/linux/input-event-codes.h:$(STAGING_DIR)/usr/include/linux/uinput.h > > $(eval $(python-package)) > diff --git a/package/python-lxml/python-lxml.mk b/package/python-lxml/python-lxml.mk > index 3ef3aabdbc..4454f5aa0c 100644 > --- a/package/python-lxml/python-lxml.mk > +++ b/package/python-lxml/python-lxml.mk > @@ -28,11 +28,11 @@ HOST_PYTHON_LXML_DEPENDENCIES = host-libxml2 host-libxslt host-zlib > # python-lxml needs these scripts in order to properly detect libxml2 and > # libxslt compiler and linker flags > PYTHON_LXML_BUILD_OPTS = \ > - --xslt-config=$(STAGING_DIR)/usr/bin/xslt-config \ > - --xml2-config=$(STAGING_DIR)/usr/bin/xml2-config > + -C--build-option=--xslt-config=$(STAGING_DIR)/usr/bin/xslt-config \ > + -C--build-option=--xml2-config=$(STAGING_DIR)/usr/bin/xml2-config > HOST_PYTHON_LXML_BUILD_OPTS = \ > - --xslt-config=$(HOST_DIR)/bin/xslt-config \ > - --xml2-config=$(HOST_DIR)/bin/xml2-config > + -C--build-option=--xslt-config=$(HOST_DIR)/bin/xslt-config \ > + -C--build-option=--xml2-config=$(HOST_DIR)/bin/xml2-config > > $(eval $(python-package)) > $(eval $(host-python-package)) > diff --git a/package/python-m2crypto/python-m2crypto.mk b/package/python-m2crypto/python-m2crypto.mk > index 69a0c28df5..6c07f42d06 100644 > --- a/package/python-m2crypto/python-m2crypto.mk > +++ b/package/python-m2crypto/python-m2crypto.mk > @@ -13,6 +13,8 @@ PYTHON_M2CRYPTO_LICENSE_FILES = LICENCE > PYTHON_M2CRYPTO_CPE_ID_VENDOR = m2crypto_project > PYTHON_M2CRYPTO_CPE_ID_PRODUCT = m2crypto > PYTHON_M2CRYPTO_DEPENDENCIES = openssl host-swig > -PYTHON_M2CRYPTO_BUILD_OPTS = --openssl=$(STAGING_DIR)/usr > +PYTHON_M2CRYPTO_BUILD_OPTS = \ > + -C--build-option=build_ext \ > + -C--build-option=--openssl=$(STAGING_DIR)/usr > > $(eval $(python-package)) > diff --git a/package/python-pillow/python-pillow.mk b/package/python-pillow/python-pillow.mk > index bc94062da8..e2077654d2 100644 > --- a/package/python-pillow/python-pillow.mk > +++ b/package/python-pillow/python-pillow.mk > @@ -14,61 +14,60 @@ PYTHON_PILLOW_CPE_ID_PRODUCT = pillow > PYTHON_PILLOW_SETUP_TYPE = setuptools > > PYTHON_PILLOW_DEPENDENCIES = host-pkgconf > -PYTHON_PILLOW_BUILD_OPTS = build_ext --disable-platform-guessing > -PYTHON_PILLOW_INSTALL_TARGET_OPTS = $(PYTHON_PILLOW_BUILD_OPTS) > +PYTHON_PILLOW_BUILD_OPTS = -C--build-option=build_ext -C--build-option=--disable-platform-guessing > > ifeq ($(BR2_PACKAGE_FREETYPE),y) > PYTHON_PILLOW_DEPENDENCIES += freetype > -PYTHON_PILLOW_BUILD_OPTS += --enable-freetype > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-freetype > else > -PYTHON_PILLOW_BUILD_OPTS += --disable-freetype > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-freetype > endif > > ifeq ($(BR2_PACKAGE_JPEG),y) > PYTHON_PILLOW_DEPENDENCIES += jpeg > -PYTHON_PILLOW_BUILD_OPTS += --enable-jpeg > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-jpeg > else > -PYTHON_PILLOW_BUILD_OPTS += --disable-jpeg > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-jpeg > endif > > ifeq ($(BR2_PACKAGE_LCMS2),y) > PYTHON_PILLOW_DEPENDENCIES += lcms2 > -PYTHON_PILLOW_BUILD_OPTS += --enable-lcms > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-lcms > else > -PYTHON_PILLOW_BUILD_OPTS += --disable-lcms > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-lcms > endif > > ifeq ($(BR2_PACKAGE_LIBXCB),y) > PYTHON_PILLOW_DEPENDENCIES += libxcb > -PYTHON_PILLOW_BUILD_OPTS += --enable-xcb > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-xcb > else > -PYTHON_PILLOW_BUILD_OPTS += --disable-xcb > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-xcb > endif > > ifeq ($(BR2_PACKAGE_OPENJPEG),y) > PYTHON_PILLOW_DEPENDENCIES += openjpeg > -PYTHON_PILLOW_BUILD_OPTS += --enable-jpeg2000 > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-jpeg2000 > else > -PYTHON_PILLOW_BUILD_OPTS += --disable-jpeg2000 > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-jpeg2000 > endif > > ifeq ($(BR2_PACKAGE_TIFF),y) > PYTHON_PILLOW_DEPENDENCIES += tiff > -PYTHON_PILLOW_BUILD_OPTS += --enable-tiff > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-tiff > else > -PYTHON_PILLOW_BUILD_OPTS += --disable-tiff > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-tiff > endif > > ifeq ($(BR2_PACKAGE_WEBP),y) > PYTHON_PILLOW_DEPENDENCIES += webp > -PYTHON_PILLOW_BUILD_OPTS += --enable-webp > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-webp > ifeq ($(BR2_PACKAGE_WEBP_DEMUX)$(BR2_PACKAGE_WEBP_MUX),yy) > -PYTHON_PILLOW_BUILD_OPTS += --enable-webpmux > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--enable-webpmux > else > -PYTHON_PILLOW_BUILD_OPTS += --disable-webpmux > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-webpmux > endif > else > -PYTHON_PILLOW_BUILD_OPTS += --disable-webp --disable-webpmux > +PYTHON_PILLOW_BUILD_OPTS += -C--build-option=--disable-webp -C--build-option=--disable-webpmux > endif > > $(eval $(python-package)) > diff --git a/package/python-psycopg2/python-psycopg2.mk b/package/python-psycopg2/python-psycopg2.mk > index 0149b8d185..1b33b7505d 100644 > --- a/package/python-psycopg2/python-psycopg2.mk > +++ b/package/python-psycopg2/python-psycopg2.mk > @@ -13,7 +13,8 @@ PYTHON_PSYCOPG2_LICENSE_FILES = LICENSE > PYTHON_PSYCOPG2_DEPENDENCIES = postgresql > # Force psycopg2 to use the Buildroot provided postgresql version > # instead of the one from the host machine > -PYTHON_PSYCOPG2_BUILD_OPTS = build_ext --pg-config=$(STAGING_DIR)/usr/bin/pg_config > -PYTHON_PSYCOPG2_INSTALL_TARGET_OPTS = build_ext --pg-config=$(STAGING_DIR)/usr/bin/pg_config > +PYTHON_PSYCOPG2_BUILD_OPTS = \ > + -C--build-option=build_ext \ > + -C--build-option=--pg-config=$(STAGING_DIR)/usr/bin/pg_config > > $(eval $(python-package)) > diff --git a/package/python-pyzmq/python-pyzmq.mk b/package/python-pyzmq/python-pyzmq.mk > index 5792957eaf..1b7bceae5e 100644 > --- a/package/python-pyzmq/python-pyzmq.mk > +++ b/package/python-pyzmq/python-pyzmq.mk > @@ -12,7 +12,7 @@ PYTHON_PYZMQ_LICENSE = LGPL-3.0+, BSD-3-Clause, Apache-2.0 > PYTHON_PYZMQ_LICENSE_FILES = COPYING.LESSER COPYING.BSD > PYTHON_PYZMQ_DEPENDENCIES = host-python-packaging zeromq > PYTHON_PYZMQ_SETUP_TYPE = setuptools > -PYTHON_PYZMQ_BUILD_OPTS = --zmq=$(STAGING_DIR)/usr > +PYTHON_PYZMQ_BUILD_OPTS = -C--build-option=--zmq=$(STAGING_DIR)/usr > > # Due to issues with cross-compiling, hardcode to the zeromq in BR > define PYTHON_PYZMQ_PATCH_ZEROMQ_VERSION > @@ -23,7 +23,7 @@ endef > PYTHON_PYZMQ_POST_PATCH_HOOKS += PYTHON_PYZMQ_PATCH_ZEROMQ_VERSION > > ifeq ($(BR2_PACKAGE_ZEROMQ_DRAFTS),y) > -PYTHON_PYZMQ_BUILD_OPTS += --enable-drafts > +PYTHON_PYZMQ_BUILD_OPTS += -C--build-option=--enable-drafts > endif > > $(eval $(python-package)) > diff --git a/package/python-uvloop/python-uvloop.mk b/package/python-uvloop/python-uvloop.mk > index 285884a2bb..70508fb6de 100644 > --- a/package/python-uvloop/python-uvloop.mk > +++ b/package/python-uvloop/python-uvloop.mk > @@ -10,8 +10,10 @@ PYTHON_UVLOOP_SITE = https://files.pythonhosted.org/packages/9c/16/728cc5dde368e > PYTHON_UVLOOP_SETUP_TYPE = setuptools > PYTHON_UVLOOP_LICENSE = Apache-2.0, MIT > PYTHON_UVLOOP_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT > -PYTHON_UVLOOP_BUILD_OPTS = build_ext --inplace --use-system-libuv > -PYTHON_UVLOOP_INSTALL_TARGET_OPTS = build_ext --inplace --use-system-libuv > PYTHON_UVLOOP_DEPENDENCIES = libuv This needs a new dependency on host-python-cython now. Otherwise it fails with the following error: ERROR Missing dependencies: Cython<0.30.0,>=0.29.36 > +PYTHON_UVLOOP_BUILD_OPTS = \ > + -C--build-option=build_ext \ > + -C--build-option=--inplace \ > + -C--build-option=--use-system-libuv > > $(eval $(python-package)) _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Buildroot] [PATCH v6 5/5] package/pkg-python.mk: migrate setuptools to pep517 2024-02-06 22:31 ` Marcus Hoffmann via buildroot @ 2024-02-07 10:10 ` Marcus Hoffmann via buildroot 0 siblings, 0 replies; 14+ messages in thread From: Marcus Hoffmann via buildroot @ 2024-02-07 10:10 UTC (permalink / raw) To: James Hilliard, buildroot Cc: Gustavo Heinz, Asaf Kahlon, Wojciech M . Zabolotny, Angelo Compagnucci, Thomas Petazzoni, Giulio Benetti On 06.02.24 23:31, Marcus Hoffmann wrote: > Hi James, all > [...] >> diff --git a/package/python-uvloop/python-uvloop.mk >> b/package/python-uvloop/python-uvloop.mk >> index 285884a2bb..70508fb6de 100644 >> --- a/package/python-uvloop/python-uvloop.mk >> +++ b/package/python-uvloop/python-uvloop.mk >> @@ -10,8 +10,10 @@ PYTHON_UVLOOP_SITE = >> https://files.pythonhosted.org/packages/9c/16/728cc5dde368e >> PYTHON_UVLOOP_SETUP_TYPE = setuptools >> PYTHON_UVLOOP_LICENSE = Apache-2.0, MIT >> PYTHON_UVLOOP_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT >> -PYTHON_UVLOOP_BUILD_OPTS = build_ext --inplace --use-system-libuv >> -PYTHON_UVLOOP_INSTALL_TARGET_OPTS = build_ext --inplace >> --use-system-libuv >> PYTHON_UVLOOP_DEPENDENCIES = libuv > > This needs a new dependency on host-python-cython now. Otherwise it > fails with the following error: > > ERROR Missing dependencies: > Cython<0.30.0,>=0.29.36 To try and clarify why this is related to the pep517 switch: This dependency is also mentioned in the pyproject.toml [1]. When using the old setup.py this way to build the project this was only sometimes required. I.e. when you either explicitly forced a rebuild of the cython-generate files or were building from a git checkout instead of the pypi source tarball. I don't know why this logic didn't carry over to the pep517 world. @James, can we systematically check for packages that might now require cython? Did you build all setuptools packages with this patch at some point and only msgpack came up with the same problem? [1] https://github.com/MagicStack/uvloop/blob/v0.18.0/pyproject.toml#L59 >> +PYTHON_UVLOOP_BUILD_OPTS = \ >> + -C--build-option=build_ext \ >> + -C--build-option=--inplace \ >> + -C--build-option=--use-system-libuv >> $(eval $(python-package)) _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2024-02-12 0:10 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-11-26 18:08 [Buildroot] [PATCH v6 1/5] package/python-poetry-core: new host package James Hilliard 2023-11-26 18:08 ` [Buildroot] [PATCH v6 2/5] package/python-terminaltables: use correct pep517 build backend James Hilliard 2023-11-26 18:08 ` [Buildroot] [PATCH v6 3/5] package/python-msgpack: add host cython dependency James Hilliard 2024-02-07 10:16 ` Marcus Hoffmann via buildroot 2024-02-07 10:17 ` Marcus Hoffmann via buildroot 2024-02-07 10:20 ` Thomas Petazzoni via buildroot 2024-02-07 17:39 ` Marcus Hoffmann via buildroot 2024-02-07 19:56 ` James Hilliard 2024-02-09 17:59 ` James Hilliard 2024-02-12 0:10 ` Marcus Hoffmann via buildroot 2023-11-26 18:08 ` [Buildroot] [PATCH v6 4/5] package/python-setuptools-rust: add host setuptools-scm dependency James Hilliard 2023-11-26 18:08 ` [Buildroot] [PATCH v6 5/5] package/pkg-python.mk: migrate setuptools to pep517 James Hilliard 2024-02-06 22:31 ` Marcus Hoffmann via buildroot 2024-02-07 10:10 ` Marcus Hoffmann via buildroot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox