Skip to contentSkip to conversation

python3-aioserial: switch to PEP-517 build backend

PATCH New alperak 1 participant 1 message Aug 8, 2024

lore
Share & tools
lore

alperak

author
#0 lore raw

PATCH 1/1 python3-aioserial: switch to PEP-517 build backend

- The project has a proper pyproject.toml which declares the poetry.core.masonry.api PEP-517 backend.

- The PyPi package name (defaults to PN without the python3- prefix), so there is no need to set PYPI_PACKAGE as aioserial, it is by default.

- The upstream pyproject.toml says it needs to be built with the Poetry frontend, but that's deprecated behaviour and it should use the Poetry Core API instead.

---
 ...poetry-core-for-pyproject-base-build.patch | 29 +++++++++++++++++++
 .../python/python3-aioserial_1.3.1.bb         |  5 ++--
 2 files changed, 31 insertions(+), 3 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-aioserial/0001-use-poetry-core-for-pyproject-base-build.patch
meta-python/recipes-devtools/python/python3-aioserial/0001-use-poetry-core-for-pyproject-base-build.patch new file +29 -0
new file mode 100644
index 000000000..139bdb4f5
@@ -0,0 +1,29 @@
+From 5798a250b465572d84a024389b173dc996690b03 Mon Sep 17 00:00:00 2001
+From: alperak <[email protected]>
+Date: Thu, 8 Aug 2024 12:56:31 +0300
+Subject: [PATCH] Use poetry-core for pyproject base build
+
+https://github.com/python-poetry/poetry-core#why-is-this-required
+
+Upstream-Status: Pending
+
+Signed-off-by: alperak <[email protected]>
+---
+ pyproject.toml | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index 6243bff..06bc409 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -15,5 +15,5 @@ python = "^3.6"
+ pyserial = "*"
+
+ [build-system]
+-requires = ["poetry>=0.12"]
+-build-backend = "poetry.masonry.api"
++requires = ["poetry-core>=0.12"]
++build-backend = "poetry.core.masonry.api"
+--
+2.25.1
+
meta-python/recipes-devtools/python/python3-aioserial_1.3.1.bb +2 -3
index 8279f2704..5acbcbf97 100755
@@ -5,11 +5,10 @@ SECTION = "devel/python"
 LICENSE = "MPL-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=650b9179efef1ea560df5c08bc32b494"
 
-PYPI_PACKAGE = "aioserial"
-
+SRC_URI += "file://0001-use-poetry-core-for-pyproject-base-build.patch"
 SRC_URI[sha256sum] = "702bf03b0eb84b8ef2d8dac5cb925e1e685dce98f77b125569bc6fd2b3b58228"
 
-inherit pypi setuptools3
+inherit pypi python_poetry_core
 
 RDEPENDS:${PN} += " \
     python3-asyncio \
Signature · 1 line
2.25.1