Skip to contentSkip to conversation

python3-pyproject-metadata: New recipe

PATCH In review Zoltán Böszörményi 2 participants 5 messages Jun 3, 2023 – Jun 5, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/3 python3-pyproject-metadata: New recipe

It is a dependency for python3-meson-python.

---
 meta/conf/distro/include/maintainers.inc        |  1 +
 .../python/python3-pyproject-metadata_0.7.1.bb  | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-pyproject-metadata_0.7.1.bb
meta/conf/distro/include/maintainers.inc +1 -0
index 0f7b7287bb..cae9d36135 100644
@@ -670,6 +670,7 @@ RECIPE_MAINTAINER:pn-python3-pygobject = "Zang Ruochen <[email protected]>
 RECIPE_MAINTAINER:pn-python3-pyopenssl = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pyparsing = "Oleksandr Kravchuk <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pyproject-hooks = "Ross Burton <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-pyproject-metadata = "Zoltán Böszörményi <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pysocks = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pytest = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pytest-runner = "Tim Orling <[email protected]>"
meta/recipes-devtools/python/python3-pyproject-metadata_0.7.1.bb new file +17 -0
new file mode 100644
index 0000000000..063df1b04f
@@ -0,0 +1,17 @@
+SUMMARY = "PEP 621 metadata parsing"
+HOMEPAGE = "https://github.com/FFY00/python-pyproject-metadata"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=310439af287b0fb4780b2ad6907c256c"
+
+PYPI_PACKAGE = "pyproject-metadata"
+
+inherit pypi python_setuptools_build_meta
+SRC_URI[sha256sum] = "0a94f18b108b9b21f3a26a3d541f056c34edcb17dc872a144a15618fed7aef67"
+
+BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS:${PN} += " \
+    python3-logging \
+    python3-packaging \
+    python3-profile \
+"
Signature · 1 line
2.40.1
#1 lore raw

PATCH v4 2/3 python3-meson-python: New recipe

This python module adds support for a new PEP517 build backend used by recent versions of scikit-image, scipy and others.

The previously added python_mesonpy.bbclass uses it

---
 meta/conf/distro/include/maintainers.inc      |  1 +
 .../python/python3-meson-python_0.13.1.bb     | 23 +++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-meson-python_0.13.1.bb
meta/conf/distro/include/maintainers.inc +1 -0
index cae9d36135..a0093001c2 100644
@@ -647,6 +647,7 @@ RECIPE_MAINTAINER:pn-python3-magic = "Joshua Watt <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-mako = "Oleksandr Kravchuk <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-markdown = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-markupsafe = "Richard Purdie <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-meson-python = "Zoltán Böszörményi <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-more-itertools = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-ndg-httpsclient = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-numpy = "Oleksandr Kravchuk <[email protected]>"
meta/recipes-devtools/python/python3-meson-python_0.13.1.bb new file +23 -0
new file mode 100644
index 0000000000..6b9ff24f2a
@@ -0,0 +1,23 @@
+SUMMARY = "Meson Python build backend (PEP 517)"
+HOMEPAGE = "https://github.com/mesonbuild/meson-python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d580b27e67cc0892a5b005b0be114b60"
+
+DEPENDS = " \
+	meson-native ninja-native patchelf-native \
+	python3-pyproject-metadata-native \
+"
+
+PYPI_PACKAGE = "meson_python"
+
+inherit pypi python_mesonpy
+SRC_URI[sha256sum] = "63b3170001425c42fa4cfedadb9051cbd28925ff8eed7c40d36ba0099e3c7618"
+
+DEPENDS:remove:class-native = "python3-meson-python-native"
+
+RDEPENDS:${PN} = " \
+	meson ninja patchelf \
+	python3-pyproject-metadata \
+"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.40.1
#2 lore raw

PATCH v4 3/3 python_mesonpy: New class

In reply to Zoltán Böszörményi

This is a new PEP517 compatible build class for python modules that use pyproject.toml and this:

[build-system]
build-backend = 'mesonpy'

The new class uses python3-meson-python-native.

---
 meta/classes-recipe/python_mesonpy.bbclass | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 meta/classes-recipe/python_mesonpy.bbclass
meta/classes-recipe/python_mesonpy.bbclass new file +54 -0
new file mode 100644
index 0000000000..1da8b005ab
@@ -0,0 +1,54 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit meson setuptools3-base python3targetconfig python_pep517
+
+# Filter out meson_do_qa_configure from do_configure[postfuncs]
+DOCONFIGUREPOSTFUNCS := "${@d.getVarFlag('do_configure', 'postfuncs')}"
+DOCONFIGUREPOSTFUNCS:remove = "meson_do_qa_configure"
+do_configure[postfuncs] := "${@'' if d.getVar('DOCONFIGUREPOSTFUNCS') is None else d.getVar('DOCONFIGUREPOSTFUNCS') }"
+
+# This prevents the meson error:
+# ERROR: Got argument buildtype as both -Dbuildtype and --buildtype. Pick one.
+MESONOPTS:remove = "--buildtype ${MESON_BUILDTYPE}"
+
+CONFIGURE_FILES = "pyproject.toml"
+
+DEPENDS += "python3-wheel-native python3-meson-python-native"
+
+def mesonpy_get_args(d):
+    vars = ['MESONOPTS', 'MESON_CROSS_FILE', 'EXTRA_OEMESON']
+    varlist = []
+    for var in vars:
+        value = d.getVar(var)
+        vallist = value.split()
+        for elem in vallist:
+            varlist.append("-Csetup-args=" + elem)
+    return ' '.join(varlist)
+
+PEP517_BUILD_OPTS = "-Cbuilddir='${B}' ${@mesonpy_get_args(d)}"
+
+# Python pyx -> c -> so build leaves absolute build paths in the code
+INSANE_SKIP:${PN} += "buildpaths"
+INSANE_SKIP:${PN}-src += "buildpaths"
+
+python_mesonpy_do_configure () {
+    python_pep517_do_configure
+}
+
+python_mesonpy_do_compile () {
+    python_pep517_do_compile
+}
+
+python_mesonpy_do_install () {
+    python_pep517_do_install
+}
+
+python_mesonpy_do_bootstrap_install () {
+    python_pep517_do_bootstrap_install
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
Signature · 1 line
2.40.1
#3 lore raw

Re: [OE-core] [PATCH v4 3/3] python_mesonpy: New class

Do you have a recipe in mind to demonstrate that this works as intended?

If there’s nothing in core that needs it, maybe it should sit in meta-python until then.

Ross

Quoted 88 lines · Zoltan Boszormenyi via lists.openembedded.org

This is a new PEP517 compatible build class for python modules that use pyproject.toml and this:

[build-system]
build-backend = 'mesonpy'

The new class uses python3-meson-python-native.

---
meta/classes-recipe/python_mesonpy.bbclass | 54 ++++++++++++++++++++++

1 file changed, 54 insertions(+)

create mode 100644 meta/classes-recipe/python_mesonpy.bbclass

meta/classes-recipe/python_mesonpy.bbclass new file +54 -0
new file mode 100644
index 0000000000..1da8b005ab
@@ -0,0 +1,54 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit meson setuptools3-base python3targetconfig python_pep517
+
+# Filter out meson_do_qa_configure from do_configure[postfuncs]
+DOCONFIGUREPOSTFUNCS := "${@d.getVarFlag('do_configure', 'postfuncs')}"
+DOCONFIGUREPOSTFUNCS:remove = "meson_do_qa_configure"
+do_configure[postfuncs] := "${@'' if d.getVar('DOCONFIGUREPOSTFUNCS') is None else d.getVar('DOCONFIGUREPOSTFUNCS') }"
+
+# This prevents the meson error:
+# ERROR: Got argument buildtype as both -Dbuildtype and --buildtype. Pick one.
+MESONOPTS:remove = "--buildtype ${MESON_BUILDTYPE}"
+
+CONFIGURE_FILES = "pyproject.toml"
+
+DEPENDS += "python3-wheel-native python3-meson-python-native"
+
+def mesonpy_get_args(d):
+    vars = ['MESONOPTS', 'MESON_CROSS_FILE', 'EXTRA_OEMESON']
+    varlist = []
+    for var in vars:
+        value = d.getVar(var)
+        vallist = value.split()
+        for elem in vallist:
+            varlist.append("-Csetup-args=" + elem)
+    return ' '.join(varlist)
+
+PEP517_BUILD_OPTS = "-Cbuilddir='${B}' ${@mesonpy_get_args(d)}"
+
+# Python pyx -> c -> so build leaves absolute build paths in the code
+INSANE_SKIP:${PN} += "buildpaths"
+INSANE_SKIP:${PN}-src += "buildpaths"
+
+python_mesonpy_do_configure () {
+    python_pep517_do_configure
+}
+
+python_mesonpy_do_compile () {
+    python_pep517_do_compile
+}
+
+python_mesonpy_do_install () {
+    python_pep517_do_install
+}
+
+python_mesonpy_do_bootstrap_install () {
+    python_pep517_do_bootstrap_install
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
Signature · 10 lines
2.40.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#182349): https://lists.openembedded.org/g/openembedded-core/message/182349
Mute This Topic: https://lists.openembedded.org/mt/99301645/6875888
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
#4 lore raw

Re: [OE-core] [PATCH v4 3/3] python_mesonpy: New class

2023. 06. 05. 13:57 keltezéssel, Ross Burton írta:

Quoted 1 line

Do you have a recipe in mind to demonstrate that this works as intended?

I have a working python3-scikit-image recipe for version 0.20.0, which uses this build backend.

meta-scipy may also use it to add a newer version of python3-scipy.

Quoted 92 lines

If there’s nothing in core that needs it, maybe it should sit in meta-python until then.

Ross

Quoted 88 lines · Zoltan Boszormenyi via lists.openembedded.org

This is a new PEP517 compatible build class for python modules that use pyproject.toml and this:

[build-system]
build-backend = 'mesonpy'

The new class uses python3-meson-python-native.

---
meta/classes-recipe/python_mesonpy.bbclass | 54 ++++++++++++++++++++++

1 file changed, 54 insertions(+)

create mode 100644 meta/classes-recipe/python_mesonpy.bbclass

meta/classes-recipe/python_mesonpy.bbclass new file +54 -0
new file mode 100644
index 0000000000..1da8b005ab
@@ -0,0 +1,54 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit meson setuptools3-base python3targetconfig python_pep517
+
+# Filter out meson_do_qa_configure from do_configure[postfuncs]
+DOCONFIGUREPOSTFUNCS := "${@d.getVarFlag('do_configure', 'postfuncs')}"
+DOCONFIGUREPOSTFUNCS:remove = "meson_do_qa_configure"
+do_configure[postfuncs] := "${@'' if d.getVar('DOCONFIGUREPOSTFUNCS') is None else d.getVar('DOCONFIGUREPOSTFUNCS') }"
+
+# This prevents the meson error:
+# ERROR: Got argument buildtype as both -Dbuildtype and --buildtype. Pick one.
+MESONOPTS:remove = "--buildtype ${MESON_BUILDTYPE}"
+
+CONFIGURE_FILES = "pyproject.toml"
+
+DEPENDS += "python3-wheel-native python3-meson-python-native"
+
+def mesonpy_get_args(d):
+    vars = ['MESONOPTS', 'MESON_CROSS_FILE', 'EXTRA_OEMESON']
+    varlist = []
+    for var in vars:
+        value = d.getVar(var)
+        vallist = value.split()
+        for elem in vallist:
+            varlist.append("-Csetup-args=" + elem)
+    return ' '.join(varlist)
+
+PEP517_BUILD_OPTS = "-Cbuilddir='${B}' ${@mesonpy_get_args(d)}"
+
+# Python pyx -> c -> so build leaves absolute build paths in the code
+INSANE_SKIP:${PN} += "buildpaths"
+INSANE_SKIP:${PN}-src += "buildpaths"
+
+python_mesonpy_do_configure () {
+    python_pep517_do_configure
+}
+
+python_mesonpy_do_compile () {
+    python_pep517_do_compile
+}
+
+python_mesonpy_do_install () {
+    python_pep517_do_install
+}
+
+python_mesonpy_do_bootstrap_install () {
+    python_pep517_do_bootstrap_install
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
Signature · 10 lines
2.40.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#182349): https://lists.openembedded.org/g/openembedded-core/message/182349
Mute This Topic: https://lists.openembedded.org/mt/99301645/6875888
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-