summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2022-01-15 21:29:04 -0800
committerKhem Raj <raj.khem@gmail.com>2022-01-18 08:59:58 -0800
commit8589b69f9ff283ec3ae990466bed3b84702eb8e1 (patch)
tree9fd5a6bfa76ae8c439b1b1afed94d770811d944b /meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py
parent6fecc883380c4dcfbb642464061aa4c51a4626ee (diff)
downloadmeta-openembedded-8589b69f9ff283ec3ae990466bed3b84702eb8e1.tar.gz
python3-cryptography: upgrade 3.3.2 -> 36.0.1
See https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst#3601---2021-12-14 for changes * Add PSF-2.0 license and explicitly add checksums for the LICENSE files that are packaged. * RDEPENDS on python3-hypothesis (in oe-core) for ptest so we can drop the patch for skipping. * Drop backported patch for openssl3 support. * 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 * Cleanup and alphabetize the RDEPENDS * 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 Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py')
-rwxr-xr-xmeta-python/recipes-devtools/python/python3-cryptography/check-memfree.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py b/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py
new file mode 100755
index 0000000000..c111a9074c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py
@@ -0,0 +1,10 @@
1#!/usr/bin/env python3
2# https://stackoverflow.com/questions/22102999/get-total-physical-memory-in-python/28161352
3import sys
4meminfo = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines())
5mem_free = meminfo['MemTotal']/1024./1024.
6if mem_free < 2.:
7 raise RuntimeError("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free))
8 sys.exit(1)
9else:
10 print("Free memory: {:.3f} GB".format(mem_free))