diff mbox series

[meta-python] python3-fastapi: add FastAPI (0.115.2)

Message ID 20250423143607.453363-1-fleuryhugo7@gmail.com
State Under Review
Headers show
Series [meta-python] python3-fastapi: add FastAPI (0.115.2) | expand

Commit Message

Hugo April 23, 2025, 2:36 p.m. UTC
FastAPI is a modern, high-performance web framework for building APIs with Python 3.7+ based on standard Python type hints.

This adds the FastAPI recipe to meta-python, along with its dependencies.

Signed-off-by: Hugo FLEURY <fleuryhugo7@gmail.com>
---
 .../python/python3-fastapi_0.115.12.bb        | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb

Comments

Khem Raj April 23, 2025, 3:55 p.m. UTC | #1
On 4/23/25 7:36 AM, Hugo via lists.openembedded.org wrote:
> FastAPI is a modern, high-performance web framework for building APIs with Python 3.7+ based on standard Python type hints.
> 
> This adds the FastAPI recipe to meta-python, along with its dependencies.
> 
> Signed-off-by: Hugo FLEURY <fleuryhugo7@gmail.com>
> ---
>   .../python/python3-fastapi_0.115.12.bb        | 23 +++++++++++++++++++
>   1 file changed, 23 insertions(+)
>   create mode 100644 meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb
> 
> diff --git a/meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb b/meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb
> new file mode 100644
> index 0000000000..e03aa08c5d
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb
> @@ -0,0 +1,23 @@
> +SUMMARY = "FastAPI - high performance API framework"
> +HOMEPAGE = "https://fastapi.tiangolo.com/"
> +LICENSE = "MIT"
> +
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=95792ff3fe8e11aa49ceb247e66e4810"
> +
> +SRC_URI[sha256sum] = "1e2c2a2646905f9e83d32f04a3f86aff4a286669c6c950ca95b5fd68c2602681"
> +
> +inherit pypi python_setuptools_build_meta
> +
> +DEPENDS += " \
> +    ${PYTHON_PN}-pdm-native \
> +    ${PYTHON_PN}-pdm-backend-native \
> +"
> +
> +RDEPENDS:${PN} += " \
> +    ${PYTHON_PN}-pydantic \
> +    ${PYTHON_PN}-pydantic-core \
> +    ${PYTHON_PN}-starlette \
> +    ${PYTHON_PN}-typing-extensions \
> +"

Please remove PYTHON_PN here, replace it with python3-

> +
> +PYPI_PACKAGE = "fastapi"
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#117080): https://lists.openembedded.org/g/openembedded-devel/message/117080
> Mute This Topic: https://lists.openembedded.org/mt/112415221/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Hugo April 25, 2025, 3:13 p.m. UTC | #2
Added tests and fixed the issue related to ${PYTHON_PN}.

Signed-off-by: Hugo FLEURY <fleuryhugo7@gmail.com>
---
.../python/python3-uvicorn/run-ptest          |  6 +++
.../python/python3-uvicorn_0.34.2.bb          | 37 +++++++++++++++++++
2 files changed, 43 insertions(+)
create mode 100644 meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
create mode 100644 meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
diff --git a/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest b/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
new file mode 100644
index 0000000000..d75b4cd4c9
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# based on the gunicorn ptest
+echo "nameserver 8.8.8.8" >> /etc/resolv.conf
+
+pytest
diff --git a/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb b/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
new file mode 100644
index 0000000000..cd2691a5ee
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Lightning-fast ASGI server implementation."
+HOMEPAGE = "https://www.uvicorn.org/"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=5c778842f66a649636561c423c0eec2e"
+
+SRC_URI[sha256sum] = "0e929828f6186353a80b58ea719861d2629d766293b6d19baf086ba31d4f3328"
+
+inherit pypi python_hatchling python_setuptools_build_meta ptest
+
+SRC_URI += "file://run-ptest"
+
+RDEPENDS:${PN}-ptest += " \
+    python3-pytest \
+    python3-httptools \
+    python3-dotenv \
+    python3-httpx \
+    python3-pyyaml \
+    python3-websockets \
+    python3-a2wsgi \
+    python3-pytest-mock \
+"
+
+do_install_ptest() {
+        install -d ${D}${PTEST_PATH}/tests
+        cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+PYPI_PACKAGE = "uvicorn"
+
+RDEPENDS:${PN} += " \
+    python3-typing-extensions \
+    python3-click \
+    python3-h11 \
+    python3-anyio \
+"
+
+S = "${WORKDIR}/uvicorn-${PV}"
--
2.43.0
Hugo April 25, 2025, 3:17 p.m. UTC | #3
This revision of the patch fix the '${PYTHON_PN}' issue to 'python3'.

Signed-off-by: Hugo FLEURY <fleuryhugo7@gmail.com>
---
.../python/python3-fastapi_0.115.12.bb        | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb
diff --git a/meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb b/meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb
new file mode 100644
index 0000000000..6c80beb7c3
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb
@@ -0,0 +1,23 @@
+SUMMARY = "FastAPI - high performance API framework"
+HOMEPAGE = "https://fastapi.tiangolo.com/"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=95792ff3fe8e11aa49ceb247e66e4810"
+
+SRC_URI[sha256sum] = "1e2c2a2646905f9e83d32f04a3f86aff4a286669c6c950ca95b5fd68c2602681"
+
+inherit pypi python_setuptools_build_meta
+
+DEPENDS += " \
+    python3-pdm-native \
+    python3-pdm-backend-native \
+"
+
+RDEPENDS:${PN} += " \
+    python3-pydantic \
+    python3-pydantic-core \
+    python3-starlette \
+    python3-typing-extensions \
+"
+
+PYPI_PACKAGE = "fastapi"
--
2.43.0
Khem Raj April 25, 2025, 9:46 p.m. UTC | #4
On Fri, Apr 25, 2025 at 8:13 AM Hugo via lists.openembedded.org
<fleuryhugo7=gmail.com@lists.openembedded.org> wrote:
>
> Added tests and fixed the issue related to ${PYTHON_PN}.
>
> Signed-off-by: Hugo FLEURY <fleuryhugo7@gmail.com>
> ---
>  .../python/python3-uvicorn/run-ptest          |  6 +++
>  .../python/python3-uvicorn_0.34.2.bb          | 37 +++++++++++++++++++
>  2 files changed, 43 insertions(+)
>  create mode 100644 meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
>  create mode 100644 meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
> diff --git a/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest b/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
> new file mode 100644
> index 0000000000..d75b4cd4c9
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
> @@ -0,0 +1,6 @@
> +#!/bin/sh
> +
> +# based on the gunicorn ptest
> +echo "nameserver 8.8.8.8" >> /etc/resolv.conf
> +
> +pytest
> diff --git a/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb b/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
> new file mode 100644
> index 0000000000..cd2691a5ee
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
> @@ -0,0 +1,37 @@
> +SUMMARY = "Lightning-fast ASGI server implementation."
> +HOMEPAGE = "https://www.uvicorn.org/"
> +LICENSE = "BSD-3-Clause"
> +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=5c778842f66a649636561c423c0eec2e"
> +
> +SRC_URI[sha256sum] = "0e929828f6186353a80b58ea719861d2629d766293b6d19baf086ba31d4f3328"
> +
> +inherit pypi python_hatchling python_setuptools_build_meta ptest
> +
> +SRC_URI += "file://run-ptest"
> +
> +RDEPENDS:${PN}-ptest += " \
> +    python3-pytest \
> +    python3-httptools \
> +    python3-dotenv \


I am seeing

ERROR: Nothing RPROVIDES 'python3-dotenv' (but
/mnt/jenkins/workspace/Yocto-world-clang/sources/meta-openembedded/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
RDEPENDS on or otherwise requires it)

dotenv module is built via meta-virtualization, so perhaps its better
to bring it to meta-python perhaps since meta-python does not depend
on meta-virtualization.


> +    python3-httpx \
> +    python3-pyyaml \
> +    python3-websockets \
> +    python3-a2wsgi \
> +    python3-pytest-mock \
> +"
> +
> +do_install_ptest() {
> +        install -d ${D}${PTEST_PATH}/tests
> +        cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
> +}
> +
> +PYPI_PACKAGE = "uvicorn"
> +
> +RDEPENDS:${PN} += " \
> +    python3-typing-extensions \
> +    python3-click \
> +    python3-h11 \
> +    python3-anyio \
> +"
> +
> +S = "${WORKDIR}/uvicorn-${PV}"
> --
> 2.43.0
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#117129): https://lists.openembedded.org/g/openembedded-devel/message/117129
> Mute This Topic: https://lists.openembedded.org/mt/112415221/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Yann CARDAILLAC Pro April 26, 2025, 11:12 a.m. UTC | #5
Hi Raj Khem,

Sorry to drop in, I've been working on those patches with Hugo.

How are we supposed to do this multi meta contribution?
How do you guys keep things coherent?

Also note that Hugo ran the test on target and there's a few error left
regarding an internal structure of python3-a2wsgi. Hugo don't hesitate to
correct me or to complete.

Uvicorn is running fine as far as we are concern but there might still be
something left.

Bests regards,

Yann CARDAILLAC,


Le ven. 25 avr. 2025 à 23:53, Khem Raj via lists.openembedded.org <raj.khem=
gmail.com@lists.openembedded.org> a écrit :

> On Fri, Apr 25, 2025 at 8:13 AM Hugo via lists.openembedded.org
> <fleuryhugo7=gmail.com@lists.openembedded.org> wrote:
> >
> > Added tests and fixed the issue related to ${PYTHON_PN}.
> >
> > Signed-off-by: Hugo FLEURY <fleuryhugo7@gmail.com>
> > ---
> >  .../python/python3-uvicorn/run-ptest          |  6 +++
> >  .../python/python3-uvicorn_0.34.2.bb          | 37 +++++++++++++++++++
> >  2 files changed, 43 insertions(+)
> >  create mode 100644
> meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
> >  create mode 100644 meta-python/recipes-devtools/python/
> python3-uvicorn_0.34.2.bb
> > diff --git
> a/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
> b/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
> > new file mode 100644
> > index 0000000000..d75b4cd4c9
> > --- /dev/null
> > +++ b/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
> > @@ -0,0 +1,6 @@
> > +#!/bin/sh
> > +
> > +# based on the gunicorn ptest
> > +echo "nameserver 8.8.8.8" >> /etc/resolv.conf
> > +
> > +pytest
> > diff --git a/meta-python/recipes-devtools/python/
> python3-uvicorn_0.34.2.bb b/meta-python/recipes-devtools/python/
> python3-uvicorn_0.34.2.bb
> > new file mode 100644
> > index 0000000000..cd2691a5ee
> > --- /dev/null
> > +++ b/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
> > @@ -0,0 +1,37 @@
> > +SUMMARY = "Lightning-fast ASGI server implementation."
> > +HOMEPAGE = "https://www.uvicorn.org/"
> > +LICENSE = "BSD-3-Clause"
> > +LIC_FILES_CHKSUM =
> "file://LICENSE.md;md5=5c778842f66a649636561c423c0eec2e"
> > +
> > +SRC_URI[sha256sum] =
> "0e929828f6186353a80b58ea719861d2629d766293b6d19baf086ba31d4f3328"
> > +
> > +inherit pypi python_hatchling python_setuptools_build_meta ptest
> > +
> > +SRC_URI += "file://run-ptest"
> > +
> > +RDEPENDS:${PN}-ptest += " \
> > +    python3-pytest \
> > +    python3-httptools \
> > +    python3-dotenv \
>
>
> I am seeing
>
> ERROR: Nothing RPROVIDES 'python3-dotenv' (but
>
> /mnt/jenkins/workspace/Yocto-world-clang/sources/meta-openembedded/meta-python/recipes-devtools/python/
> python3-uvicorn_0.34.2.bb
> RDEPENDS on or otherwise requires it)
>
> dotenv module is built via meta-virtualization, so perhaps its better
> to bring it to meta-python perhaps since meta-python does not depend
> on meta-virtualization.
>
>
> > +    python3-httpx \
> > +    python3-pyyaml \
> > +    python3-websockets \
> > +    python3-a2wsgi \
> > +    python3-pytest-mock \
> > +"
> > +
> > +do_install_ptest() {
> > +        install -d ${D}${PTEST_PATH}/tests
> > +        cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
> > +}
> > +
> > +PYPI_PACKAGE = "uvicorn"
> > +
> > +RDEPENDS:${PN} += " \
> > +    python3-typing-extensions \
> > +    python3-click \
> > +    python3-h11 \
> > +    python3-anyio \
> > +"
> > +
> > +S = "${WORKDIR}/uvicorn-${PV}"
> > --
> > 2.43.0
> >
> >
> >
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#117137):
> https://lists.openembedded.org/g/openembedded-devel/message/117137
> Mute This Topic: https://lists.openembedded.org/mt/112415221/9753132
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> yann.cardaillac@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb b/meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb
new file mode 100644
index 0000000000..e03aa08c5d
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-fastapi_0.115.12.bb
@@ -0,0 +1,23 @@ 
+SUMMARY = "FastAPI - high performance API framework"
+HOMEPAGE = "https://fastapi.tiangolo.com/"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=95792ff3fe8e11aa49ceb247e66e4810"
+
+SRC_URI[sha256sum] = "1e2c2a2646905f9e83d32f04a3f86aff4a286669c6c950ca95b5fd68c2602681"
+
+inherit pypi python_setuptools_build_meta
+
+DEPENDS += " \
+    ${PYTHON_PN}-pdm-native \
+    ${PYTHON_PN}-pdm-backend-native \
+"
+
+RDEPENDS:${PN} += " \
+    ${PYTHON_PN}-pydantic \
+    ${PYTHON_PN}-pydantic-core \
+    ${PYTHON_PN}-starlette \
+    ${PYTHON_PN}-typing-extensions \
+"
+
+PYPI_PACKAGE = "fastapi"