Skip to contentSkip to conversation

python3-setuptools-rust-native: from meta-python

PATCH In review Richard Purdie 2 participants 34 messages Mar 14, 2022 – Jan 30

lore
Share & tools
lore
#0 lore raw

PATCH 1/33 python3-setuptools-rust-native: from meta-python

From: Tim Orling <[email protected]>

Dependency for python3-cryptography 3.4.x+

Only native rustc is supported at this time in oe-core, therefore it makes no sense to try to build for target.

---
 .../python3-setuptools-rust-native_1.1.2.bb   | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb
meta/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb new file +33 -0
new file mode 100644
index 00000000000..73dcbb26e67
@@ -0,0 +1,33 @@
+SUMMARY = "Setuptools Rust extension plugin"
+DESCRIPTION = "setuptools-rust is a plugin for setuptools to build Rust \
+Python extensions implemented with PyO3 or rust-cpython.\
+\
+Compile and distribute Python extensions written in Rust as easily as if they were written in C."
+HOMEPAGE = "https://github.com/PyO3/setuptools-rust"
+BUGTRACKER = "https://github.com/PyO3/setuptools-rust/issues"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=011cd92e702dd9e6b1a26157b6fd53f5"
+
+SRC_URI = "https://files.pythonhosted.org/packages/67/08/e1aa2c582c62ac76e4d60f8e454bd3bba933781a06a88b4e38797445822a/setuptools-rust-${PV}.tar.gz"
+SRC_URI[sha256sum] = "a0adb9b503c0ffc4e8fe80b7c617898cefa78049983aaaea7f747e153a3e65d1"
+
+# While this has a pyproject.toml and declares that setuptools_build_meta should work
+# it results in a wheel named UNKNOWN-0.0.0-py3-none-any.whl so stay with setuptools3
+# until that can be resolved
+inherit cargo pypi setuptools3 native
+
+# For some reason the wheel is built in ${S} not ${B}
+PIP_INSTALL_DIST_PATH = "${S}/dist"
+PIP_INSTALL_PACKAGE = "setuptools_rust"
+
+DEPENDS += "python3-setuptools-scm-native python3-wheel-native"
+
+RDEPENDS:${PN}:class-native += " \
+    python3-semantic-version-native \
+    python3-setuptools-native \
+    python3-setuptools-scm-native \
+    python3-toml-native \
+    python3-typing-extensions-native \
+    python3-wheel-native \
+"
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/33 python3-setuptools-rust-native: remove obsolete PIP_*

From: Ross Burton <[email protected]>

---
 .../python/python3-setuptools-rust-native_1.1.2.bb            | 4 ----
 1 file changed, 4 deletions(-)
meta/recipes-devtools/python/python3-setuptools-rust-native_1.1.2.bb +0 -4
index 73dcbb26e67..2b929727005 100644
@@ -17,10 +17,6 @@ SRC_URI[sha256sum] = "a0adb9b503c0ffc4e8fe80b7c617898cefa78049983aaaea7f747e153a
 # until that can be resolved
 inherit cargo pypi setuptools3 native
 
-# For some reason the wheel is built in ${S} not ${B}
-PIP_INSTALL_DIST_PATH = "${S}/dist"
-PIP_INSTALL_PACKAGE = "setuptools_rust"
-
 DEPENDS += "python3-setuptools-scm-native python3-wheel-native"
 
 RDEPENDS:${PN}:class-native += " \
Signature · 1 line
2.32.0
#2 lore raw

PATCH 3/33 pyo3.bbclass: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

PyO3 provides Rust bindings for Python, including tools for creating native Python extension modules. Running and interacting with Python code from a Rust binary is also supported.

This class sets up the cross-compilation environment.

Export PYO3_CROSS, PYO3_CROSS_LIB_DIR, PYO3_CROSS_INCLUDE_DIR and CARGO_BUILD_TARGET to inform tools like setuptools-rust we are cross-compiling.

Export RUSTFLAGS so cargo can find 'std' and 'core' for target

Dynamically generate PyO3 config file and export PYO3_CONFIG_FILE absolute path. This is the trick that finally made pyo3 work.

---
 meta/classes/pyo3.bbclass | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 meta/classes/pyo3.bbclass
meta/classes/pyo3.bbclass new file +30 -0
new file mode 100644
index 00000000000..6ce21329c2e
@@ -0,0 +1,30 @@
+#
+# This class helps make sure that Python extensions built with PyO3
+# and setuptools_rust properly set up the environment for cross compilation
+#
+
+inherit cargo python3-dir siteinfo
+
+export PYO3_CROSS="1"
+export PYO3_CROSS_PYTHON_VERSION="${PYTHON_BASEVERSION}"
+export PYO3_CROSS_LIB_DIR="${STAGING_LIBDIR}"
+export CARGO_BUILD_TARGET="${HOST_SYS}"
+export RUSTFLAGS
+export PYO3_PYTHON="${PYTHON}"
+export PYO3_CONFIG_FILE="${WORKDIR}/pyo3.config"
+
+pyo3_do_configure () {
+    cat > ${WORKDIR}/pyo3.config << EOF
+implementation=CPython
+version=${PYTHON_BASEVERSION}
+shared=true
+abi3=false
+lib_name=${PYTHON_DIR}
+lib_dir=${STAGING_LIBDIR}
+pointer_width=${SITEINFO_BITS}
+build_flags=WITH_THREAD
+suppress_build_script_link_lines=false
+EOF
+}
+
+EXPORT_FUNCTIONS do_configure
Signature · 1 line
2.32.0
#3 lore raw

PATCH 4/33 setuptools3_rust.bbclass: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

setuptools-rust is a plugin for setuptools to build Rust Python extensions implemented with PyO3 or rust-cpython.

Compile and distribute Python extensions written in Rust as easily as if they were written in C.

This class inherits pyo3.bbclass (and therefore cargo.bbclass) and setuptools3.bbclass to make it easier to build Python modules with Rust extensions.

Need to call pyo3_do_configure to properly setup the PyO3 environment for cross-compiling.

Need to call cargo_common_do_configure to setup cargo_home/config so that the linker properly finds e.g. crti.o and crtbeginS.o

It is strongly recommended to provide crates needed for your recipe using the crate:// fetcher. This can be helped with the cargo-bitbake command [1].

If you choose not to use the crate fetcher, bitbake vendoring will not work with setuptools-rust, as it errors out immediately because it cannot find pyo3 or some other crate. The (strongly discouraged) workaround for this is to set:

CARGO_DISABLE_BITBAKE_VENDORING = "1"

[1] https://crates.io/crates/cargo-bitbake

---
 meta/classes/setuptools3_rust.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 meta/classes/setuptools3_rust.bbclass
meta/classes/setuptools3_rust.bbclass new file +11 -0
new file mode 100644
index 00000000000..fb11f08f89c
@@ -0,0 +1,11 @@
+inherit pyo3 setuptools3
+
+DEPENDS += "python3-setuptools-rust-native"
+
+setuptools3_rust_do_configure() {
+    pyo3_do_configure
+    cargo_common_do_configure
+    setuptools3_do_configure
+}
+
+EXPORT_FUNCTIONS do_configure
Signature · 1 line
2.32.0
#4 lore raw

PATCH 5/33 python3-cryptography: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

* inherit new setuptools_rust class (which inherits new pyo3 class, which inherits cargo and python3-dir).
* RDEPENDS on python3-pytest-subtests for ptest
* Copy pyproject.toml for ptest as it defines the pytest.marker(s) needed
* Use 'cargo bitbake' to generate the crate:// SRC_URIs
- Needed some hacks to the Cargo.toml in src/rust/ to make this work (probably only package.repository was strictly required):

[package]
description = "cryptography includes both high level recipes and low level interfaces to common cryptographic algorithms such as symmetric ciphers, message digests, and key derivation functions." homepage = "https://github.com/pyca/cryptography"
repository = "https://github.com/pyca/cryptography"

* Add patches to src/rust/Cargo.toml to fix cargo errors including pem version
* Add check-memfree.py to ptest to check for sufficient free memory

---
 .../0001-Cargo.toml-specify-pem-version.patch |  31 +++++
 .../0002-Cargo.toml-edition-2018-2021.patch   |  28 ++++
 .../python3-cryptography/check-memfree.py     |  10 ++
 .../python/python3-cryptography/run-ptest     |   4 +
 .../python/python3-cryptography_36.0.1.bb     | 123 ++++++++++++++++++
 5 files changed, 196 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch
 create mode 100644 meta/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch
 create mode 100755 meta/recipes-devtools/python/python3-cryptography/check-memfree.py
 create mode 100644 meta/recipes-devtools/python/python3-cryptography/run-ptest
 create mode 100644 meta/recipes-devtools/python/python3-cryptography_36.0.1.bb
meta/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch new file +31 -0
new file mode 100644
index 00000000000..d7ab757bb51
@@ -0,0 +1,31 @@
+From ec8d3f3c61280c8140b34ed1479baef5e706f064 Mon Sep 17 00:00:00 2001
+From: Tim Orling <[email protected]>
+Date: Fri, 14 Jan 2022 22:02:25 -0800
+Subject: [PATCH] Cargo.toml: specify pem version
+
+pem = "1.0" is not resolving, specify the current
+pem = { version: "1.0.2"}
+
+Upstream-Status: Pending
+
+Signed-off-by: Tim Orling <[email protected]>
+---
+ src/rust/Cargo.toml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml
+index 617167d0..174eaa80 100644
+--- a/src/rust/Cargo.toml
++++ b/src/rust/Cargo.toml
+@@ -9,7 +9,7 @@ publish = false
+ lazy_static = "1"
+ pyo3 = { version = "0.15.1" }
+ asn1 = { version = "0.8.7", default-features = false, features = ["derive"] }
+-pem = "1.0"
++pem = { version = "1.0.2" }
+ chrono = { version = "0.4", default-features = false, features = ["alloc", "clock"] }
+ ouroboros = "0.13"
+ 
+-- 
+2.30.2
+
meta/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch new file +28 -0
new file mode 100644
index 00000000000..366e3a4d39a
@@ -0,0 +1,28 @@
+From 4b73298b214a5b69ea6edf3c2e21dd82b2b29708 Mon Sep 17 00:00:00 2001
+From: Tim Orling <[email protected]>
+Date: Fri, 14 Jan 2022 22:34:59 -0800
+Subject: [PATCH 2/2] Cargo.toml: edition 2018 -> 2021
+
+Upstream-Status: Pending
+
+Signed-off-by: Tim Orling <[email protected]>
+---
+ src/rust/Cargo.toml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml
+index 174eaa80..7ad053d9 100644
+--- a/src/rust/Cargo.toml
++++ b/src/rust/Cargo.toml
+@@ -2,7 +2,7 @@
+ name = "cryptography-rust"
+ version = "0.1.0"
+ authors = ["The cryptography developers <[email protected]>"]
+-edition = "2018"
++edition = "2021"
+ publish = false
+ 
+ [dependencies]
+-- 
+2.30.2
+
meta/recipes-devtools/python/python3-cryptography/check-memfree.py new file +10 -0
new file mode 100755
index 00000000000..c111a9074c1
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+# https://stackoverflow.com/questions/22102999/get-total-physical-memory-in-python/28161352
+import sys
+meminfo = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines())
+mem_free = meminfo['MemTotal']/1024./1024.
+if mem_free < 2.:
+    raise RuntimeError("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free))
+    sys.exit(1)
+else:
+    print("Free memory: {:.3f} GB".format(mem_free))
meta/recipes-devtools/python/python3-cryptography/run-ptest new file +4 -0
new file mode 100644
index 00000000000..1e97dda63e7
@@ -0,0 +1,4 @@
+#!/bin/sh
+if ./check-memfree.py; then
+    pytest -vvvv tests/
+fi
meta/recipes-devtools/python/python3-cryptography_36.0.1.bb new file +123 -0

123 lines not on this page · raw message

Signature · 1 line
2.32.0
#5 lore raw

PATCH 6/33 python3-pytest-subtests: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography ptest.

---
 .../python/python3-pytest-subtests_0.6.0.bb   | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-pytest-subtests_0.6.0.bb
meta/recipes-devtools/python/python3-pytest-subtests_0.6.0.bb new file +20 -0
new file mode 100644
index 00000000000..5e4847b8d94
@@ -0,0 +1,20 @@
+SUMMARY = "unittest subTest() support and subtests fixture."
+DESCRIPTION = "Adds support for TestCase.subTest.\
+New subtests fixture, providing similar functionality for pure pytest tests."
+HOMEPAGE = "https://github.com/pytest-dev/pytest-subtests"
+BUGTRACKER = "https://github.com/pytest-dev/pytest-subtests/issues"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=242b4e17fa287dcf7aef372f6bc3dcb1"
+
+SRC_URI[sha256sum] = "3ebd306a8dcf75133f1742f288c82f36426ebcf8a132d4ee89782d20e84fc13a"
+
+inherit pypi setuptools3
+
+DEPENDS += "${PYTHON_PN}-setuptools-scm-native"
+
+RDEPENDS:${PN} += " \
+    ${PYTHON_PN}-pytest \
+"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.32.0
#6 lore raw

PATCH 7/33 python3-cryptography-vectors: from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography ptest.

This recipe needs to be kept in lock-step with the version of python3-cryptography.

---
 .../python3-cryptography-vectors_36.0.1.bb    | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-cryptography-vectors_36.0.1.bb
meta/recipes-devtools/python/python3-cryptography-vectors_36.0.1.bb new file +24 -0
new file mode 100644
index 00000000000..b9e6b811c37
@@ -0,0 +1,24 @@
+SUMMARY = "Test vectors for the cryptography package."
+HOMEPAGE = "https://cryptography.io/"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0 | BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8c3617db4fb6fae01f1d253ab91511e4 \
+                    file://LICENSE.APACHE;md5=4e168cce331e5c827d4c2b68a6200e1b \
+                    file://LICENSE.BSD;md5=5ae30ba4123bc4f2fa49aa0b0dce887b"
+
+# NOTE: Make sure to keep this recipe at the same version as python3-cryptography
+#       Upgrade both recipes at the same time
+
+SRC_URI[sha256sum] = "fc8490afd5424342b868215435bd174dcd76ab396b4ea9435498be5721dcd598"
+
+PYPI_PACKAGE = "cryptography_vectors"
+
+inherit pypi setuptools3
+
+DEPENDS += " \
+    ${PYTHON_PN}-cryptography \
+"
+
+BBCLASSEXTEND = "native nativesdk"
+
+UPSTREAM_CHECK_REGEX = ""
Signature · 1 line
2.32.0
#7 lore raw

PATCH 8/33 python3-asn1crypto: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../python/python3-asn1crypto_1.4.0.bb        | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-asn1crypto_1.4.0.bb
meta/recipes-devtools/python/python3-asn1crypto_1.4.0.bb new file +25 -0
new file mode 100644
index 00000000000..c052cb8c827
@@ -0,0 +1,25 @@
+DESCRIPTION = "A fast, pure Python library for parsing and serializing ASN.1 structures"
+HOMEPAGE = "https://github.com/wbond/asn1crypto"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7439e38f5e04ff62fae436184786b7ca"
+
+PYPI_PACKAGE = "asn1crypto"
+
+SRC_URI[md5sum] = "00bf5b72d37778e62cc73b1d8909ae27"
+SRC_URI[sha256sum] = "f4f6e119474e58e04a2b1af817eb585b4fd72bdd89b998624712b5c99be7641c"
+
+inherit pypi setuptools3
+
+RDEPENDS:${PN}:class-target += " \
+    ${PYTHON_PN}-codecs \
+    ${PYTHON_PN}-crypt \
+    ${PYTHON_PN}-ctypes \
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-io \
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-numbers \
+    ${PYTHON_PN}-shell \
+"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.32.0
#8 lore raw

PATCH 9/33 python3-cffi: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../python/python3-cffi_1.15.0.bb              | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-cffi_1.15.0.bb
meta/recipes-devtools/python/python3-cffi_1.15.0.bb new file +18 -0
new file mode 100644
index 00000000000..c36f23b3dde
@@ -0,0 +1,18 @@
+SUMMARY = "Foreign Function Interface for Python calling C code"
+HOMEPAGE = "http://cffi.readthedocs.org/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5677e2fdbf7cdda61d6dd2b57df547bf"
+DEPENDS += "libffi ${PYTHON_PN}-pycparser"
+
+SRC_URI[sha256sum] = "920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954"
+
+inherit pypi setuptools3
+
+RDEPENDS:${PN}:class-target = " \
+    ${PYTHON_PN}-ctypes \
+    ${PYTHON_PN}-io \
+    ${PYTHON_PN}-pycparser \
+    ${PYTHON_PN}-shell \
+"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.32.0
#9 lore raw

PATCH 10/33 python3-pytz: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../python/python3-pytz/run-ptest             |  3 ++
 .../python/python3-pytz_2021.3.bb             | 35 +++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-pytz/run-ptest
 create mode 100644 meta/recipes-devtools/python/python3-pytz_2021.3.bb
meta/recipes-devtools/python/python3-pytz/run-ptest new file +3 -0
new file mode 100644
index 00000000000..b63c4de0d9a
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta/recipes-devtools/python/python3-pytz_2021.3.bb new file +35 -0
new file mode 100644
index 00000000000..119342a4bd7
@@ -0,0 +1,35 @@
+SUMMARY = "World timezone definitions, modern and historical"
+HOMEPAGE = "http://pythonhosted.org/pytz"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=1a67fc46c1b596cce5d21209bbe75999"
+
+inherit pypi setuptools3 ptest
+
+SRC_URI[sha256sum] = "acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326"
+
+RDEPENDS:${PN}:class-target += "\
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-doctest \
+    ${PYTHON_PN}-io \
+    ${PYTHON_PN}-pickle \
+    ${PYTHON_PN}-pprint \
+    ${PYTHON_PN}-threading \
+"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI += " \
+	file://run-ptest \
+"
+
+RDEPENDS:${PN}-ptest += " \
+	${PYTHON_PN}-pytest \
+"
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/pytz
+	install -d ${D}${PTEST_PATH}/pytz/tests
+	cp -rf ${S}/pytz/tests/* ${D}${PTEST_PATH}/pytz/tests/
+	cp -f ${S}/README.rst ${D}${PTEST_PATH}/
+
+}
Signature · 1 line
2.32.0
#10 lore raw

PATCH 11/33 python3-bcrypt: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../python/python3-bcrypt/run-ptest           |  3 ++
 .../python/python3-bcrypt_3.2.0.bb            | 30 +++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-bcrypt/run-ptest
 create mode 100644 meta/recipes-devtools/python/python3-bcrypt_3.2.0.bb
meta/recipes-devtools/python/python3-bcrypt/run-ptest new file +3 -0
new file mode 100644
index 00000000000..b63c4de0d9a
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta/recipes-devtools/python/python3-bcrypt_3.2.0.bb new file +30 -0
new file mode 100644
index 00000000000..92a6a0d8c5f
@@ -0,0 +1,30 @@
+DESCRIPTION = "Modern password hashing for your software and your servers."
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8f7bb094c7232b058c7e9f2e431f389c"
+
+DEPENDS += "${PYTHON_PN}-cffi-native"
+
+SRC_URI[md5sum] = "fe31390dab603728f756cd3d6830c80a"
+SRC_URI[sha256sum] = "5b93c1726e50a93a033c36e5ca7fdcd29a5c7395af50a6892f5d9e7c6cfbfb29"
+
+inherit pypi setuptools_build_meta ptest
+
+SRC_URI += " \
+	file://run-ptest \
+"
+
+RDEPENDS:${PN}-ptest += " \
+	${PYTHON_PN}-pytest \
+"
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/tests
+	cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+RDEPENDS:${PN}:class-target += "\
+    ${PYTHON_PN}-cffi \
+    ${PYTHON_PN}-ctypes \
+    ${PYTHON_PN}-shell \
+    ${PYTHON_PN}-six \
+"
Signature · 1 line
2.32.0
#11 lore raw

PATCH 12/33 python3-pretend: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 meta/recipes-devtools/python/python3-pretend_1.0.9.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-pretend_1.0.9.bb
meta/recipes-devtools/python/python3-pretend_1.0.9.bb new file +11 -0
new file mode 100644
index 00000000000..21d14a03b8d
@@ -0,0 +1,11 @@
+SUMMARY = "A library for stubbing in Python"
+HOMEPAGE = "https://github.com/alex/pretend"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=411780c0b7fa756753e94affeee5bc99"
+
+SRC_URI[md5sum] = "ad53883ede48aeac7ae584f0de0240e8"
+SRC_URI[sha256sum] = "c90eb810cde8ebb06dafcb8796f9a95228ce796531bc806e794c2f4649aa1b10"
+
+inherit pypi setuptools3
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.32.0
#12 lore raw

PATCH 13/33 python3-psutil: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../0001-fix-failure-test-cases.patch         | 197 ++++++++++++++++++
 .../python/python3-psutil_5.9.0.bb            |  28 +++
 2 files changed, 225 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-psutil/0001-fix-failure-test-cases.patch
 create mode 100644 meta/recipes-devtools/python/python3-psutil_5.9.0.bb
meta/recipes-devtools/python/python3-psutil/0001-fix-failure-test-cases.patch new file +197 -0
new file mode 100644
index 00000000000..34ea03b27f3
@@ -0,0 +1,197 @@
+From 8b4e38958ff8bdbb3ece4796bfa2d3b6f7536f71 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Wed, 23 Feb 2022 11:54:40 +0800
+Subject: [PATCH] fix failure test cases
+
+The test cases is not robust enough. skip some cases that is
+not suitable for all conditions.
+
+* test_io_counters failed when kernel config CONFIG_TASKSTATS
+  and CONFIG_TASK_IO_ACCOUNTING are not enable in OE 
+* test_setup_script failed since oe don't install setup.py
+* test_used failed since oe use git source for free, so the version
+  is 3.3.17-dirty
+* test_weird_environ failed since gcc not installed
+* test_debug failed since it is designed to run when PSUTIL_DEBUG is set
+* test_against_findmnt/test_comparisons/test_disk_partitions_mocked/
+  test_disk_partitions is not suitable for Linux nfs boot
+
+Upstream-Status: Pending
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ psutil/tests/test_contracts.py | 1 +
+ psutil/tests/test_linux.py     | 8 ++++++--
+ psutil/tests/test_misc.py      | 4 ++++
+ psutil/tests/test_process.py   | 5 +++++
+ psutil/tests/test_system.py    | 1 +
+ psutil/tests/test_unicode.py   | 4 +++-
+ 6 files changed, 20 insertions(+), 3 deletions(-)
+
+diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py
+index 7401cc1..bf0fca0 100755
+--- a/psutil/tests/test_contracts.py
++++ b/psutil/tests/test_contracts.py
+@@ -172,6 +172,7 @@ class TestAvailProcessAPIs(PsutilTestCase):
+     def test_rlimit(self):
+         self.assertEqual(hasattr(psutil.Process, "rlimit"), LINUX or FREEBSD)
+ 
++    @unittest.skip("broken on OE since kernel config maye not be enabled")
+     def test_io_counters(self):
+         hasit = hasattr(psutil.Process, "io_counters")
+         self.assertEqual(hasit, False if MACOS or SUNOS else True)
+diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py
+index 20e28d2..66b6dda 100755
+--- a/psutil/tests/test_linux.py
++++ b/psutil/tests/test_linux.py
+@@ -196,8 +196,9 @@ def get_free_version_info():
+     out = sh(["free", "-V"]).strip()
+     if 'UNKNOWN' in out:
+         raise unittest.SkipTest("can't determine free version")
+-    return tuple(map(int, out.split()[-1].split('.')))
+-
++    vlist = out.split()[-1].split('.')
++    vlist[:] = [n.split('-')[0] for n in vlist]
++    return tuple(map(int, vlist))
+ 
+ @contextlib.contextmanager
+ def mock_open_content(for_path, content):
+@@ -1289,6 +1290,7 @@ class TestRootFsDeviceFinder(PsutilTestCase):
+         finder.ask_sys_class_block()
+ 
+     @unittest.skipIf(GITHUB_ACTIONS, "unsupported on GITHUB_ACTIONS")
++    @unittest.skip("Broken for oe")
+     def test_comparisons(self):
+         finder = RootFsDeviceFinder()
+         self.assertIsNotNone(finder.find())
+@@ -1311,11 +1313,13 @@ class TestRootFsDeviceFinder(PsutilTestCase):
+ 
+     @unittest.skipIf(not which("findmnt"), "findmnt utility not available")
+     @unittest.skipIf(GITHUB_ACTIONS, "unsupported on GITHUB_ACTIONS")
++    @unittest.skip("Broken for oe")
+     def test_against_findmnt(self):
+         psutil_value = RootFsDeviceFinder().find()
+         findmnt_value = sh("findmnt -o SOURCE -rn /")
+         self.assertEqual(psutil_value, findmnt_value)
+ 
++    @unittest.skip("Broken for oe")
+     def test_disk_partitions_mocked(self):
+         with mock.patch(
+                 'psutil._pslinux.cext.disk_partitions',
+diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py
+index d946eb6..121004a 100755
+--- a/psutil/tests/test_misc.py
++++ b/psutil/tests/test_misc.py
+@@ -54,6 +54,8 @@ from psutil.tests import unittest
+ # ===================================================================
+ 
+ 
++PSUTIL_DEBUG = bool(os.getenv('PSUTIL_DEBUG', 0))
++
+ class TestMisc(PsutilTestCase):
+ 
+     def test_process__repr__(self, func=repr):
+@@ -368,6 +370,7 @@ class TestMisc(PsutilTestCase):
+ 
+     # XXX: https://github.com/pypa/setuptools/pull/2896
+     @unittest.skipIf(APPVEYOR, "temporarily disabled due to setuptools bug")
++    @unittest.skip("OE run this test outof source tree")
+     def test_setup_script(self):
+         setup_py = os.path.join(ROOT_DIR, 'setup.py')
+         if CI_TESTING and not os.path.exists(setup_py):
+@@ -401,6 +404,7 @@ class TestMisc(PsutilTestCase):
+                 reload_module(psutil)
+             self.assertIn("version conflict", str(cm.exception).lower())
+ 
++    @unittest.skipIf(not PSUTIL_DEBUG, "env PSUTIL_DEBUG not set")
+     def test_debug(self):
+         if PY3:
+             from io import StringIO
+diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py
+index c9059e3..a34ba3d 100755
+--- a/psutil/tests/test_process.py
++++ b/psutil/tests/test_process.py
+@@ -36,6 +36,7 @@ from psutil._compat import PY3
+ from psutil._compat import FileNotFoundError
+ from psutil._compat import long
+ from psutil._compat import super
++from psutil._compat import which
+ from psutil.tests import APPVEYOR
+ from psutil.tests import CI_TESTING
+ from psutil.tests import GITHUB_ACTIONS
+@@ -726,6 +727,7 @@ class TestProcess(PsutilTestCase):
+             self.assertEqual(' '.join(p.cmdline()), ' '.join(cmdline))
+ 
+     @unittest.skipIf(PYPY, "broken on PYPY")
++    @unittest.skipIf(not which("gcc"), "gcc not installed")
+     def test_long_cmdline(self):
+         testfn = self.get_testfn()
+         create_exe(testfn)
+@@ -740,6 +742,7 @@ class TestProcess(PsutilTestCase):
+         assert pyexe.startswith(name), (pyexe, name)
+ 
+     @unittest.skipIf(PYPY, "unreliable on PYPY")
++    @unittest.skipIf(not which("gcc"), "gcc not installed")
+     def test_long_name(self):
+         testfn = self.get_testfn(suffix="0123456789" * 2)
+         create_exe(testfn)
+@@ -750,6 +753,7 @@ class TestProcess(PsutilTestCase):
+     @unittest.skipIf(SUNOS, "broken on SUNOS")
+     @unittest.skipIf(AIX, "broken on AIX")
+     @unittest.skipIf(PYPY, "broken on PYPY")
++    @unittest.skipIf(not which("gcc"), "gcc not installed")
+     def test_prog_w_funky_name(self):
+         # Test that name(), exe() and cmdline() correctly handle programs
+         # with funky chars such as spaces and ")", see:
+@@ -1408,6 +1412,7 @@ class TestProcess(PsutilTestCase):
+ 
+     @unittest.skipIf(not HAS_ENVIRON, "not supported")
+     @unittest.skipIf(not POSIX, "POSIX only")
++    @unittest.skipIf(not which("gcc"), "gcc not installed")
+     def test_weird_environ(self):
+         # environment variables can contain values without an equals sign
+         code = textwrap.dedent("""
+diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py
+index db2cb34..5ee519f 100755
+--- a/psutil/tests/test_system.py
++++ b/psutil/tests/test_system.py
+@@ -580,6 +580,7 @@ class TestDiskAPIs(PsutilTestCase):
+     def test_disk_usage_bytes(self):
+         psutil.disk_usage(b'.')
+ 
++    @unittest.skip("Broken for oe")
+     def test_disk_partitions(self):
+         def check_ntuple(nt):
+             self.assertIsInstance(nt.device, str)
+diff --git a/psutil/tests/test_unicode.py b/psutil/tests/test_unicode.py
+index e635726..7ba5b0f 100755
+--- a/psutil/tests/test_unicode.py
++++ b/psutil/tests/test_unicode.py
+@@ -86,6 +86,7 @@ from psutil import POSIX
+ from psutil import WINDOWS
+ from psutil._compat import PY3
+ from psutil._compat import u
++from psutil._compat import which
+ from psutil.tests import APPVEYOR
+ from psutil.tests import ASCII_FS
+ from psutil.tests import CI_TESTING
+@@ -156,7 +157,7 @@ def try_unicode(suffix):
+ # FS APIs
+ # ===================================================================
+ 
+-
[email protected](not which("gcc"), "gcc not installed")
+ class BaseUnicodeTest(PsutilTestCase):
+     funky_suffix = None
+ 
+@@ -169,6 +170,7 @@ class BaseUnicodeTest(PsutilTestCase):
+ @serialrun
+ @unittest.skipIf(ASCII_FS, "ASCII fs")
+ @unittest.skipIf(PYPY and not PY3, "too much trouble on PYPY2")
[email protected](not which("gcc"), "gcc not installed")
+ class TestFSAPIs(BaseUnicodeTest):
+     """Test FS APIs with a funky, valid, UTF8 path name."""
+ 
+-- 
+2.25.1
+
meta/recipes-devtools/python/python3-psutil_5.9.0.bb new file +28 -0
new file mode 100644
index 00000000000..3df0e5d003e
@@ -0,0 +1,28 @@
+SUMMARY = "A cross-platform process and system utilities module for Python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e35fd9f271d19d5f742f20a9d1f8bb8b"
+
+SRC_URI[sha256sum] = "869842dbd66bb80c3217158e629d6fceaecc3a3166d3d1faee515b05dd26ca25"
+
+inherit pypi setuptools3
+
+SRC_URI += "file://0001-fix-failure-test-cases.patch"
+
+PACKAGES =+ "${PN}-tests"
+
+FILES:${PN}-tests += " \
+    ${PYTHON_SITEPACKAGES_DIR}/psutil/test* \
+    ${PYTHON_SITEPACKAGES_DIR}/psutil/__pycache__/test* \
+"
+
+
+RDEPENDS:${PN} += " \
+    ${PYTHON_PN}-shell \
+    ${PYTHON_PN}-threading \
+    ${PYTHON_PN}-xml \
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-ctypes \
+    ${PYTHON_PN}-resource \
+"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.32.0
#13 lore raw

PATCH 14/33 poetry_core.bbclass: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

poetry.core.masonry.api is one of the common PEP-517 build backends.

---
 meta/classes/poetry_core.bbclass | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 meta/classes/poetry_core.bbclass
meta/classes/poetry_core.bbclass new file +15 -0
new file mode 100644
index 00000000000..fb37c78c782
@@ -0,0 +1,15 @@
+inherit pip_install_wheel python3native setuptools3-base
+
+DEPENDS += "python3-poetry-core-native"
+
+poetry_core_do_configure () {
+    :
+}
+
+# TODO: ideally this uses pypa/build
+poetry_core_do_compile () {
+    nativepython3 -c "from poetry.core.masonry import api; api.build_wheel('${PIP_INSTALL_DIST_PATH}')"
+}
+do_compile[cleandirs] += "${PIP_INSTALL_DIST_PATH}"
+
+EXPORT_FUNCTIONS do_configure do_compile
Signature · 1 line
2.32.0
#14 lore raw

PATCH 15/33 python3-poetry-core: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

A PEP 517 build backend implementation developed for Poetry. This project is intended to be a light weight, fully compliant, self-contained package allowing PEP 517 compatible build frontends to build Poetry managed projects.

---
 .../python/python3-poetry-core_1.0.8.bb       | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-poetry-core_1.0.8.bb
meta/recipes-devtools/python/python3-poetry-core_1.0.8.bb new file +46 -0
new file mode 100644
index 00000000000..99ec763c4d5
@@ -0,0 +1,46 @@
+SUMMARY = "Poetry PEP 517 Build Backend"
+DESCRIPTION = "Poetry PEP 517 Build Backend"
+HOMEPAGE = "https://github.com/python-poetry/poetry-core"
+BUGTRACKER = "https://github.com/python-poetry/poetry-core"
+CHANGELOG = "https://github.com/python-poetry/poetry-core/blob/master/CHANGELOG.md"
+
+LICENSE = "Apache-2.0 & BSD-2-Clause & MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=104d5c3c653aeededf4076773aa4c236 \
+                    file://poetry/core/_vendor/attrs.LICENSE;md5=75bb9823a2778b5a2bd9b793fac93ea2 \
+                    file://poetry/core/_vendor/jsonschema/COPYING;md5=6554d3a51d7cb0b611891317f3c69057 \
+                    file://poetry/core/_vendor/jsonschema/LICENSE;md5=2ecb81765361195731a6f72a89e449fd \
+                    file://poetry/core/_vendor/lark-parser.LICENSE;md5=b37b83a9cf129d92ee65aaa71c01ce72 \
+                    file://poetry/core/_vendor/packaging/LICENSE;md5=7a6e56c9d54ecd731ab31c52de7942f0 \
+                    file://poetry/core/_vendor/packaging/LICENSE.APACHE;md5=29256199be2a609aac596980ffc11996 \
+                    file://poetry/core/_vendor/packaging/LICENSE.BSD;md5=f405810d173a1618433827928768bcd2 \
+                    file://poetry/core/_vendor/pyparsing.LICENSE;md5=fb46329938e6bc829b256e37d5c1e31a \
+                    file://poetry/core/_vendor/pyrsistent/LICENSE.mit;md5=1211a1ac6eac40020d0f99c39b4e4270 \
+                    file://poetry/core/_vendor/six.LICENSE;md5=6a574656da93d9ef05431b45907e35b6 \
+                    file://poetry/core/_vendor/tomlkit/LICENSE;md5=be329e5ef9c9fe86738c9afe6ef3c11c \
+                    "
+
+SRC_URI[sha256sum] = "951fc7c1f8d710a94cb49019ee3742125039fc659675912ea614ac2aa405b118"
+
+inherit poetry_core pypi
+
+PIP_INSTALL_PACKAGE = "poetry_core"
+
+RDEPENDS:${PN}:append:class-target = "\
+    python3-compression \
+    python3-core \
+    python3-crypt \
+    python3-io \
+    python3-json \
+    python3-logging \
+    python3-netclient \
+    python3-pathlib2 \
+    python3-pprint \
+    python3-shell \
+"
+
+RDEPENDS:${PN} += "\
+    python3-pip \
+    python3-six \
+"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.32.0
#15 lore raw

PATCH 16/33 python3-poetry-core: remove obsolete PIP_INSTALL_PACKAGE

In reply to Richard Purdie

From: Ross Burton <[email protected]>

---
 meta/recipes-devtools/python/python3-poetry-core_1.0.8.bb | 2 --
 1 file changed, 2 deletions(-)
meta/recipes-devtools/python/python3-poetry-core_1.0.8.bb +0 -2
index 99ec763c4d5..22d7076d01b 100644
@@ -23,8 +23,6 @@ SRC_URI[sha256sum] = "951fc7c1f8d710a94cb49019ee3742125039fc659675912ea614ac2aa4
 
 inherit poetry_core pypi
 
-PIP_INSTALL_PACKAGE = "poetry_core"
-
 RDEPENDS:${PN}:append:class-target = "\
     python3-compression \
     python3-core \
Signature · 1 line
2.32.0
#16 lore raw

PATCH 17/33 python3-iso8601: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../python/python3-iso8601_1.0.2.bb               | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-iso8601_1.0.2.bb
meta/recipes-devtools/python/python3-iso8601_1.0.2.bb new file +15 -0
new file mode 100644
index 00000000000..aabc47d69b9
@@ -0,0 +1,15 @@
+SUMMARY = "Simple module to parse ISO 8601 dates"
+HOMEPAGE = "http://pyiso8601.readthedocs.org/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b05625f2336fa024e8d57e65c6595844"
+
+SRC_URI[sha256sum] = "27f503220e6845d9db954fb212b95b0362d8b7e6c1b2326a87061c3de93594b1"
+
+inherit pypi poetry_core
+
+RDEPENDS:${PN} += "\
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-numbers \
+"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.32.0
#17 lore raw

PATCH 18/33 python3-typing-extensions: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../python/python3-typing-extensions_3.10.0.0.bb     | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-typing-extensions_3.10.0.0.bb
meta/recipes-devtools/python/python3-typing-extensions_3.10.0.0.bb new file +12 -0
new file mode 100644
index 00000000000..a5f491c7700
@@ -0,0 +1,12 @@
+HOMEPAGE = "https://github.com/python/typing"
+LICENSE = "PSF-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=64fc2b30b67d0a8423c250e0386ed72f"
+
+# The name on PyPi is slightly different.
+PYPI_PACKAGE = "typing_extensions"
+
+SRC_URI[sha256sum] = "50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342"
+
+inherit pypi setuptools3
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.32.0
#18 lore raw

PATCH 19/33 python3-semantic-version: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../python/python3-semantic-version_2.9.0.bb         | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-semantic-version_2.9.0.bb
meta/recipes-devtools/python/python3-semantic-version_2.9.0.bb new file +12 -0
new file mode 100644
index 00000000000..ee635871bf5
@@ -0,0 +1,12 @@
+SUMMARY  = "A library implementing the 'SemVer' scheme."
+DESCRIPTION = "Semantic version comparison for Python (see http://semver.org/)"
+HOMEPAGE = "https://github.com/rbarrois/python-semanticversion"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4fb31e3c1c7eeb8b5e8c07657cdd54e2"
+
+SRC_URI[sha256sum] = "abf54873553e5e07a6fd4d5f653b781f5ae41297a493666b59dcf214006a12b2"
+
+PYPI_PACKAGE = "semantic_version"
+inherit pypi setuptools3
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.32.0
#19 lore raw

PATCH 20/33 python3-pycparser: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../python/python3-pycparser_2.21.bb          | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-pycparser_2.21.bb
meta/recipes-devtools/python/python3-pycparser_2.21.bb new file +21 -0
new file mode 100644
index 00000000000..53b7367903e
@@ -0,0 +1,21 @@
+SUMMARY = "Parser of the C language, written in pure Python"
+HOMEPAGE = "https://github.com/eliben/pycparser"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2c28cdeabcb88f5843d934381b4b4fea"
+
+SRC_URI[sha256sum] = "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"
+
+inherit pypi setuptools3
+
+BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS:${PN}:class-target += "\
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-ply \
+    ${PYTHON_PN}-pprint \
+    "
+
+RSUGGESTS:${PN}:class-target += "\
+    cpp \
+    cpp-symlinks \
+    "
Signature · 1 line
2.32.0
#20 lore raw

PATCH 21/33 python3-ply: move from meta-python

In reply to Richard Purdie

From: Tim Orling <[email protected]>

Dependency for python3-cryptography

---
 .../python/python3-ply_3.11.bb                 | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-ply_3.11.bb
meta/recipes-devtools/python/python3-ply_3.11.bb new file +18 -0
new file mode 100644
index 00000000000..99c037bb734
@@ -0,0 +1,18 @@
+SUMMARY = "Python Lex and Yacc"
+DESCRIPTION = "Python ply: PLY is yet another implementation of lex and yacc for Python"
+HOMEPAGE = "https://pypi.python.org/pypi/ply"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://README.md;beginline=5;endline=32;md5=f5ee5c355c0e6719c787a71b8f0fa96c"
+
+SRC_URI[md5sum] = "6465f602e656455affcd7c5734c638f8"
+SRC_URI[sha256sum] = "00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3"
+
+inherit pypi setuptools3
+
+RDEPENDS:${PN}:class-target += "\
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-shell \
+"
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.32.0
#21 lore raw

Re: [OE-core] [PATCH 21/33] python3-ply: move from meta-python

From almost 4 years ago:

Quoted 7 lines · Richard Purdie

From: Tim Orling<[email protected]>

Dependency for python3-cryptography

---
  .../python/python3-ply_3.11.bb                 | 18 ++++++++++++++++++

I was looking at a python3-ply CVE the other day and I noticed that
the upstream repository was archived by the owner on Dec 21, 2025. It is now read-only.
https://github.com/dabeaz/ply

so we'll have to see if anyone takes over maintenance or if the users switch to a different lex/yacc in python implementation.

On master there are only 2 current users via a layer index depends query:

https://layers.openembedded.org/layerindex/branch/master/recipes/?q=depends%3Apython3-ply

but there could be some recipes that use it such as meta-sca.

I don't see where it was ever used by python3-cryptography but it is still declared as a dependency  for spdx-tools:

❯ rg python3-ply
..
meta/recipes-devtools/python/python3-spdx-tools_0.8.3.bb
16:# Dependencies required for conversion to spdx3 : python3-semantic-version, python3-ply 24:  python3-ply \

Consider this a head up for those CCed.

Since it's not maintained, it would be nice to replace it or if not really used by spdx-tools, move it back to meta-oe.

../Randy

Quoted 28 lines
  1 file changed, 18 insertions(+)

create mode 100644 meta/recipes-devtools/python/python3-ply_3.11.bb

meta/recipes-devtools/python/python3-ply_3.11.bb new file +18 -0
new file mode 100644
index 00000000000..99c037bb734
@@ -0,0 +1,18 @@
+SUMMARY = "Python Lex and Yacc"
+DESCRIPTION = "Python ply: PLY is yet another implementation of lex and yacc for Python"
+HOMEPAGE ="https://pypi.python.org/pypi/ply"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM ="file://README.md;beginline=5;endline=32;md5=f5ee5c355c0e6719c787a71b8f0fa96c"
+
+SRC_URI[md5sum] = "6465f602e656455affcd7c5734c638f8"
+SRC_URI[sha256sum] = "00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3"
+
+inherit pypi setuptools3
+
+RDEPENDS:${PN}:class-target += "\
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-shell \
+"
+
+BBCLASSEXTEND = "native"
Signature · 2 lines
# Randy MacLeod
# Wind River Linux
#22 lore raw

PATCH 22/33 maintainers.inc: add python3-crypto and friends

In reply to Richard Purdie

From: Tim Orling <[email protected]>

---
 meta/conf/distro/include/maintainers.inc | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
meta/conf/distro/include/maintainers.inc +16 -0
index 3fceb6701bb..f149db81cde 100644
@@ -587,8 +587,13 @@ RECIPE_MAINTAINER:pn-pulseaudio-client-conf-sato = "Unassigned <unassigned@yocto
 RECIPE_MAINTAINER:pn-puzzles = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER:pn-python3 = "Oleksandr Kravchuk <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-async = "Oleksandr Kravchuk <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-asn1crypto = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-atomicwrites = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-attrs = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-bcrypt = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-cffi = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-cryptography = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-cryptography-vectors = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-cython = "Oleksandr Kravchuk <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-dbus = "Zang Ruochen <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-dbusmock = "Oleksandr Kravchuk <[email protected]>"
@@ -607,6 +612,7 @@ RECIPE_MAINTAINER:pn-python3-idna = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-importlib-metadata = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-iniconfig = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-iniparse = "Oleksandr Kravchuk <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-iso8601 = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-jinja2 = "Richard Purdie <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-jsonpointer = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-jsonschema = "Bruce Ashfield <[email protected]>"
@@ -622,20 +628,29 @@ RECIPE_MAINTAINER:pn-python3-pathlib2 = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pbr = "Zang Ruochen <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pip = "Zang Ruochen <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pluggy = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-ply = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-poetry-core = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-pretend = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-psutil = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-py = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pyyaml = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pycairo = "Zang Ruochen <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-pycparser = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pyelftools = "Joshua Watt <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pygments = "Oleksandr Kravchuk <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pygobject = "Zang Ruochen <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pyparsing = "Oleksandr Kravchuk <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-pytest = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-pytest-subtests = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-pytz = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-rfc3339-validator = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-rfc3986-validator = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-rfc3987 = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-ruamel-yaml = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-scons = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-semantic-version = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-setuptools = "Oleksandr Kravchuk <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-setuptools-rust-native = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-setuptools-scm = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-six = "Zang Ruochen <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-smartypants = "Alexander Kanavin <[email protected]>"
@@ -646,6 +661,7 @@ RECIPE_MAINTAINER:pn-python3-subunit = "Oleksandr Kravchuk <open.source@oleksand
 RECIPE_MAINTAINER:pn-python3-testtools = "Oleksandr Kravchuk <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-toml = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-tomli = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-python3-typing-extensions = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-typogrify = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-vcversioner = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-python3-wcwidth = "Tim Orling <[email protected]>"
Signature · 1 line
2.32.0
#23 lore raw

PATCH 23/33 py3o: Rename to python_py3o

In reply to Richard Purdie
---
 meta/classes/{pyo3.bbclass => python_pyo3.bbclass} | 2 +-
 meta/classes/setuptools3_rust.bbclass              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename meta/classes/{pyo3.bbclass => python_pyo3.bbclass} (96%)
meta/classes/python_pyo3.bbclass renamed from meta/classes/pyo3.bbclass +1 -1
similarity index 96%
rename from meta/classes/pyo3.bbclass
rename to meta/classes/python_pyo3.bbclass
index 6ce21329c2e..10cc3a06457 100644
@@ -13,7 +13,7 @@ export RUSTFLAGS
 export PYO3_PYTHON="${PYTHON}"
 export PYO3_CONFIG_FILE="${WORKDIR}/pyo3.config"
 
-pyo3_do_configure () {
+python_pyo3_do_configure () {
     cat > ${WORKDIR}/pyo3.config << EOF
 implementation=CPython
 version=${PYTHON_BASEVERSION}
meta/classes/setuptools3_rust.bbclass +1 -1
index fb11f08f89c..fa8508fbec6 100644
@@ -1,4 +1,4 @@
-inherit pyo3 setuptools3
+inherit python_pyo3 setuptools3
 
 DEPENDS += "python3-setuptools-rust-native"
 
Signature · 1 line
2.32.0
#24 lore raw

PATCH 24/33 setuptools3_rust: Rename to python_setuptools3_rust

In reply to Richard Purdie
---
 ...tuptools3_rust.bbclass => python_setuptools3_rust.bbclass} | 4 ++--
 meta/recipes-devtools/python/python3-cryptography_36.0.1.bb   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
 rename meta/classes/{setuptools3_rust.bbclass => python_setuptools3_rust.bbclass} (70%)
meta/classes/python_setuptools3_rust.bbclass renamed from meta/classes/setuptools3_rust.bbclass +2 -2
similarity index 70%
rename from meta/classes/setuptools3_rust.bbclass
rename to meta/classes/python_setuptools3_rust.bbclass
index fa8508fbec6..f12e5d0cbd2 100644
@@ -2,8 +2,8 @@ inherit python_pyo3 setuptools3
 
 DEPENDS += "python3-setuptools-rust-native"
 
-setuptools3_rust_do_configure() {
-    pyo3_do_configure
+python_setuptools3_rust_do_configure() {
+    python_pyo3_do_configure
     cargo_common_do_configure
     setuptools3_do_configure
 }
meta/recipes-devtools/python/python3-cryptography_36.0.1.bb +1 -1
index 00791dce2de..11466ecece6 100644
@@ -18,7 +18,7 @@ SRC_URI += " \
     file://0002-Cargo.toml-edition-2018-2021.patch \
 "
 
-inherit pypi setuptools3_rust
+inherit pypi python_setuptools3_rust
 
 PIP_INSTALL_DIST_PATH = "${S}/dist"
 
Signature · 1 line
2.32.0
#25 lore raw

PATCH 25/33 poetry_core: Rename to python_poetry_core

In reply to Richard Purdie
---
 .../{poetry_core.bbclass => python_poetry_core.bbclass}       | 4 ++--
 meta/recipes-devtools/python/python3-iso8601_1.0.2.bb         | 2 +-
 meta/recipes-devtools/python/python3-poetry-core_1.0.8.bb     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
 rename meta/classes/{poetry_core.bbclass => python_poetry_core.bbclass} (82%)
meta/classes/python_poetry_core.bbclass renamed from meta/classes/poetry_core.bbclass +2 -2
similarity index 82%
rename from meta/classes/poetry_core.bbclass
rename to meta/classes/python_poetry_core.bbclass
index fb37c78c782..a2086b11b6c 100644
@@ -2,12 +2,12 @@ inherit pip_install_wheel python3native setuptools3-base
 
 DEPENDS += "python3-poetry-core-native"
 
-poetry_core_do_configure () {
+python_poetry_core_do_configure () {
     :
 }
 
 # TODO: ideally this uses pypa/build
-poetry_core_do_compile () {
+python_poetry_core_do_compile () {
     nativepython3 -c "from poetry.core.masonry import api; api.build_wheel('${PIP_INSTALL_DIST_PATH}')"
 }
 do_compile[cleandirs] += "${PIP_INSTALL_DIST_PATH}"
meta/recipes-devtools/python/python3-iso8601_1.0.2.bb +1 -1
index aabc47d69b9..93af233d296 100644
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=b05625f2336fa024e8d57e65c6595844"
 
 SRC_URI[sha256sum] = "27f503220e6845d9db954fb212b95b0362d8b7e6c1b2326a87061c3de93594b1"
 
-inherit pypi poetry_core
+inherit pypi python_poetry_core
 
 RDEPENDS:${PN} += "\
     ${PYTHON_PN}-datetime \
meta/recipes-devtools/python/python3-poetry-core_1.0.8.bb +1 -1
index 22d7076d01b..f3e9b055218 100644
@@ -21,7 +21,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=104d5c3c653aeededf4076773aa4c236 \
 
 SRC_URI[sha256sum] = "951fc7c1f8d710a94cb49019ee3742125039fc659675912ea614ac2aa405b118"
 
-inherit poetry_core pypi
+inherit python_poetry_core pypi
 
 RDEPENDS:${PN}:append:class-target = "\
     python3-compression \
Signature · 1 line
2.32.0
#26 lore raw

PATCH 26/33 poetry_core: update for renamed class pip_install_wheel to python_pep517

In reply to Richard Purdie

From: Ross Burton <[email protected]>

---
 meta/classes/python_poetry_core.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes/python_poetry_core.bbclass +3 -3
index a2086b11b6c..47b2fe46d5f 100644
@@ -1,4 +1,4 @@
-inherit pip_install_wheel python3native setuptools3-base
+inherit python_pep517 python3native setuptools3-base
 
 DEPENDS += "python3-poetry-core-native"
 
@@ -8,8 +8,8 @@ python_poetry_core_do_configure () {
 
 # TODO: ideally this uses pypa/build
 python_poetry_core_do_compile () {
-    nativepython3 -c "from poetry.core.masonry import api; api.build_wheel('${PIP_INSTALL_DIST_PATH}')"
+    nativepython3 -c "from poetry.core.masonry import api; api.build_wheel('${PEP517_WHEEL_PATH}')"
 }
-do_compile[cleandirs] += "${PIP_INSTALL_DIST_PATH}"
+do_compile[cleandirs] += "${PEP517_WHEEL_PATH}"
 
 EXPORT_FUNCTIONS do_configure do_compile
Signature · 1 line
2.32.0
#27 lore raw

PATCH 27/33 ptest-packagelists.inc: add python3-cryptography

In reply to Richard Purdie

From: Tim Orling <[email protected]>

The python3-cryptography recipe has a lot of tests and uses a large amount of memory. It is slow (> 30 seconds).

---
 meta/conf/distro/include/ptest-packagelists.inc | 1 +
 1 file changed, 1 insertion(+)
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index c503a6a5949..af8a57bec4f 100644
@@ -86,6 +86,7 @@ PTESTS_SLOW = "\
     openssh-ptest \
     openssl-ptest \
     perl-ptest \
+    python3-cryptography-ptest \
     python3-ptest \
     strace-ptest \
     tcl-ptest \
Signature · 1 line
2.32.0
#28 lore raw

PATCH 28/33 ptest-packagelists: add python3-bcrypt and -pytz

In reply to Richard Purdie

From: Tim Orling <[email protected]>

python3-bcrypt and python3-pytz both run in just a few seconds, so add them to the fast list.

---
 meta/conf/distro/include/ptest-packagelists.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/distro/include/ptest-packagelists.inc +2 -0
index af8a57bec4f..715a8f6f70b 100644
@@ -49,12 +49,14 @@ PTESTS_FAST = "\
     pango-ptest \
     parted-ptest \
     python3-atomicwrites-ptest \
+    python3-bcrypt-ptest \
     python3-hypothesis-ptest \
     python3-jinja2-ptest \
     python3-jsonpointer-ptest \
     python3-markupsafe-ptest \
     python3-more-itertools-ptest \
     python3-pluggy-ptest \
+    python3-pytz-ptest \
     python3-wcwidth-ptest \
     python3-webcolors-ptest \
     qemu-ptest \
Signature · 1 line
2.32.0
#29 lore raw

PATCH 29/33 python3-cryptography: mark test_create_certificate_with_extensions as expected to fail

In reply to Richard Purdie

From: Ross Burton <[email protected]>

This test causes OpenSSL to leak some memory. Until this is resolved in OpenSSL, mark the test as expected-to-fail.

---
 .../skip-leaky-test.patch                     | 19 +++++++++++++++++++
 .../python/python3-cryptography_36.0.1.bb     |  1 +
 2 files changed, 20 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-cryptography/skip-leaky-test.patch
meta/recipes-devtools/python/python3-cryptography/skip-leaky-test.patch new file +19 -0
new file mode 100644
index 00000000000..64248d57bd9
@@ -0,0 +1,19 @@
+Mark as test as expected-failure, OpenSSL is leaking memory.
+
+xfail not skip so we can remove this when OpenSSL doesn't leak anymore.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <[email protected]>
+
+diff --git a/tests/hazmat/backends/test_openssl_memleak.py b/tests/hazmat/backends/test_openssl_memleak.py
+index 835c9256..639f6ba2 100644
+--- a/tests/hazmat/backends/test_openssl_memleak.py
++++ b/tests/hazmat/backends/test_openssl_memleak.py
+@@ -466,6 +466,7 @@ class TestOpenSSLMemoryLeaks:
+             )
+         )
+ 
++    @pytest.mark.xfail(reason="has memory leaks")
+     def test_create_certificate_with_extensions(self):
+         assert_no_memory_leaks(
+             textwrap.dedent(
meta/recipes-devtools/python/python3-cryptography_36.0.1.bb +1 -0
index 11466ecece6..69eeeb1e968 100644
@@ -16,6 +16,7 @@ SRC_URI += " \
     file://check-memfree.py \
     file://0001-Cargo.toml-specify-pem-version.patch \
     file://0002-Cargo.toml-edition-2018-2021.patch \
+    file://skip-leaky-test.patch \
 "
 
 inherit pypi python_setuptools3_rust
Signature · 1 line
2.32.0
#30 lore raw

PATCH 30/33 python3-psutil/python3-bcrypt: Add missing HOMEPAGE

In reply to Richard Purdie

Add missing HOMEPAGE entries to the two recipes imported from meta-oe to fix selftest failures.

---
 meta/recipes-devtools/python/python3-bcrypt_3.2.0.bb | 1 +
 meta/recipes-devtools/python/python3-psutil_5.9.0.bb | 1 +
 2 files changed, 2 insertions(+)
meta/recipes-devtools/python/python3-bcrypt_3.2.0.bb +1 -0
index 92a6a0d8c5f..731aff299ba 100644
@@ -1,6 +1,7 @@
 DESCRIPTION = "Modern password hashing for your software and your servers."
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=8f7bb094c7232b058c7e9f2e431f389c"
+HOMEPAGE = "https://pypi.org/project/bcrypt/"
 
 DEPENDS += "${PYTHON_PN}-cffi-native"
 
meta/recipes-devtools/python/python3-psutil_5.9.0.bb +1 -0
index 3df0e5d003e..df304f01e69 100644
@@ -1,6 +1,7 @@
 SUMMARY = "A cross-platform process and system utilities module for Python"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=e35fd9f271d19d5f742f20a9d1f8bb8b"
+HOMEPAGE = "https://pypi.org/project/psutil/"
 
 SRC_URI[sha256sum] = "869842dbd66bb80c3217158e629d6fceaecc3a3166d3d1faee515b05dd26ca25"
 
Signature · 1 line
2.32.0
#31 lore raw

PATCH 31/33 python3-cryptography: Add missing ptest tomli dependency

In reply to Richard Purdie

Add missing tomli runtime dependency to allow ptests to execute.

---
 meta/recipes-devtools/python/python3-cryptography_36.0.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3-cryptography_36.0.1.bb +1 -0
index 69eeeb1e968..09f940272a4 100644
@@ -101,6 +101,7 @@ RDEPENDS:${PN}-ptest += " \
     ${PYTHON_PN}-pytest \
     ${PYTHON_PN}-pytest-subtests \
     ${PYTHON_PN}-pytz \
+    ${PYTHON_PN}-tomli \
 "
 
 inherit ptest
Signature · 1 line
2.32.0
#32 lore raw

PATCH 32/33 python3-cryptography: remove obsolete PIP_INSTALL_DIST_PATH

In reply to Richard Purdie

From: Ross Burton <[email protected]>

---
 meta/recipes-devtools/python/python3-cryptography_36.0.1.bb | 2 --
 1 file changed, 2 deletions(-)
meta/recipes-devtools/python/python3-cryptography_36.0.1.bb +0 -2
index 09f940272a4..e33eaa50834 100644
@@ -21,8 +21,6 @@ SRC_URI += " \
 
 inherit pypi python_setuptools3_rust
 
-PIP_INSTALL_DIST_PATH = "${S}/dist"
-
 DEPENDS += " \
     ${PYTHON_PN}-asn1crypto-native \
     ${PYTHON_PN}-cffi-native \
Signature · 1 line
2.32.0
#33 lore raw

PATCH 33/33 python3-cryptography-vectors: Fix reproducibility

In reply to Richard Purdie

We regenerate the pycache files and the checksums in the manifest are incorrect. Remove them to avoid this and ensure reproducibility.

---
 .../python/python3-cryptography-vectors_36.0.1.bb            | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-devtools/python/python3-cryptography-vectors_36.0.1.bb +5 -0
index b9e6b811c37..da6718fb90c 100644
@@ -19,6 +19,11 @@ DEPENDS += " \
     ${PYTHON_PN}-cryptography \
 "
 
+do_install:append () {
+	# Remove the sha256 checksum lines for pycache files
+	sed ${D}${PYTHON_SITEPACKAGES_DIR}/cryptography_vectors-${PV}.dist-info/RECORD -e '/__pycache__/d' -i
+}
+
 BBCLASSEXTEND = "native nativesdk"
 
 UPSTREAM_CHECK_REGEX = ""
Signature · 1 line
2.32.0