diff mbox series

python3-requests: Add PACKAGECONFIG for chardet/charset-normalizer

Message ID 20260916164630.2563205-2-alex.kiernan@gmail.com
State New
Headers show
Series python3-requests: Add PACKAGECONFIG for chardet/charset-normalizer | expand

Commit Message

Alex Kiernan Sept. 16, 2026, 4:46 p.m. UTC
Requests 2.26 added charset-normalizer as an alternative to chardet,
since 2.28 it is the default and chardet is the option. 2.32 makes both
of them optional to minimise footprint, falling back to UTF-8.

python3-charset-normalizer is a fraction of the size of python3-chardet,
but only exists in meta-python, not oe-core, so is not selected here.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
 meta/recipes-devtools/python/python3-requests_2.34.2.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Tim Orling Sept. 16, 2026, 6:08 p.m. UTC | #1
On Wed, Sep 16, 2026 at 9:47 AM Alex Kiernan via lists.openembedded.org
<alex.kiernan=gmail.com@lists.openembedded.org> wrote:

> Requests 2.26 added charset-normalizer as an alternative to chardet,
> since 2.28 it is the default and chardet is the option. 2.32 makes both
> of them optional to minimise footprint, falling back to UTF-8.
>
> python3-charset-normalizer is a fraction of the size of python3-chardet,
> but only exists in meta-python, not oe-core, so is not selected here.
>

This is reason enough to move python3-chardet-normalizer to or-core IMHO.
But that could wait for 6.2…

>
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> ---
>  meta/recipes-devtools/python/python3-requests_2.34.2.bb | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/python/python3-requests_2.34.2.bb
> b/meta/recipes-devtools/python/python3-requests_2.34.2.bb
> index 8230e8ce43b2..9e7dc14f6a84 100644
> --- a/meta/recipes-devtools/python/python3-requests_2.34.2.bb
> +++ b/meta/recipes-devtools/python/python3-requests_2.34.2.bb
> @@ -17,7 +17,6 @@ do_install:append:class-nativesdk() {
>
>  RDEPENDS:${PN} += "\
>      python3-certifi \
> -    python3-chardet \
>      python3-compression \
>      python3-email \
>      python3-idna \
> @@ -27,6 +26,13 @@ RDEPENDS:${PN} += "\
>      python3-urllib3 \
>  "
>
> +# Requests 2.26 added charset-normalizer as an alternative to chardet,
> since
> +# 2.28 it is the default and chardet is the option. 2.32 makes both of
> them
> +# optional to minimise footprint, falling back to UTF-8.
> +PACKAGECONFIG ?= "chardet"
> +PACKAGECONFIG[chardet] = ",,,python3-chardet"
> +PACKAGECONFIG[charset-normalizer] = ",,,python3-charset-normalizer"
> +
>  FILES:${PN}:append:class-nativesdk = "
> ${SDKPATHNATIVE}/environment-setup.d/python3-requests.sh"
>
>  CVE_PRODUCT = "requests"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#245991):
> https://lists.openembedded.org/g/openembedded-core/message/245991
> Mute This Topic: https://lists.openembedded.org/mt/121281983/924729
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> ticotimo@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-requests_2.34.2.bb b/meta/recipes-devtools/python/python3-requests_2.34.2.bb
index 8230e8ce43b2..9e7dc14f6a84 100644
--- a/meta/recipes-devtools/python/python3-requests_2.34.2.bb
+++ b/meta/recipes-devtools/python/python3-requests_2.34.2.bb
@@ -17,7 +17,6 @@  do_install:append:class-nativesdk() {
 
 RDEPENDS:${PN} += "\
     python3-certifi \
-    python3-chardet \
     python3-compression \
     python3-email \
     python3-idna \
@@ -27,6 +26,13 @@  RDEPENDS:${PN} += "\
     python3-urllib3 \
 "
 
+# Requests 2.26 added charset-normalizer as an alternative to chardet, since
+# 2.28 it is the default and chardet is the option. 2.32 makes both of them
+# optional to minimise footprint, falling back to UTF-8.
+PACKAGECONFIG ?= "chardet"
+PACKAGECONFIG[chardet] = ",,,python3-chardet"
+PACKAGECONFIG[charset-normalizer] = ",,,python3-charset-normalizer"
+
 FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/python3-requests.sh"
 
 CVE_PRODUCT = "requests"