Skip to contentSkip to conversation

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

PATCH In review Alex Kiernan 2 participants 2 messages Sep 16

lore
Share & tools
lore
#0 lore raw

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

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.

---
 meta/recipes-devtools/python/python3-requests_2.34.2.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-requests_2.34.2.bb +7 -1
index 8230e8ce43b2..9e7dc14f6a84 100644
@@ -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"
#1 lore raw
Quoted 7 lines · Alex Kiernan via lists.openembedded.org

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…

Quoted 48 lines
---
 meta/recipes-devtools/python/python3-requests_2.34.2.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-requests_2.34.2.bb +1 -1
index 8230e8ce43b2..9e7dc14f6a84 100644
@@ -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

meta/recipes-devtools/python/python3-requests_2.34.2.bb +5 -0
+# 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: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-