]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
python3-urllib3: remove rust dependency
authorRoss Burton <ross.burton@arm.com>
Mon, 27 Oct 2025 22:49:05 +0000 (22:49 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 30 Oct 2025 11:06:22 +0000 (11:06 +0000)
python3-cryptography (and thus, rust-native) is only needed by the
urllib3.contrib.pyopenssl module, which is not recommended for use up
the urllib3 upstream maintainers:

  Module for using pyOpenSSL as a TLS backend. This module was relevant
  before the standard library ssl module supported SNI, but now that
  we've dropped support for Python 2.7 all relevant Python versions
  support SNI so **this module is no longer recommended**.

Add a PACKAGECONFIG to control whether this module is shipped, and
disable it by default.

This removes rust-native from the default build of urllib3, which is in
the dependencies of other common modules such as requests and sphinx.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3-urllib3_2.5.0.bb

index a4f39957309dd3a28180f158862560aca620ab42..62fdf8e345ad9999b1a8b957710c52e825c6e4e6 100644 (file)
@@ -7,18 +7,23 @@ SRC_URI[sha256sum] = "3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbf
 
 inherit pypi python_hatchling
 
-DEPENDS += " \
-    python3-hatch-vcs-native \
-"
+DEPENDS += "python3-hatch-vcs-native"
+
+PACKAGECONFIG ??= ""
+# This is not recommended for use upstream, and has large dependencies
+PACKAGECONFIG[openssl] = ",,,python3-cryptography python3-pyopenssl"
+
+do_install:append() {
+    if ! ${@bb.utils.contains("PACKAGECONFIG", "openssl", "true", "false", d)}; then
+        rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/urllib3/contrib/pyopenssl.py
+    fi
+}
 
 RDEPENDS:${PN} += "\
-    python3-certifi \
-    python3-cryptography \
-    python3-email \
     python3-idna \
+    python3-email \
     python3-json \
     python3-netclient \
-    python3-pyopenssl \
     python3-threading \
     python3-logging \
 "