diff options
| author | Tim Orling <tim.orling@konsulko.com> | 2022-03-12 12:53:54 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-16 08:48:08 +0000 |
| commit | c6f79207f8183eb3ec366dff39df070563e0e6e2 (patch) | |
| tree | cadefa8e6e2de8e7d436e7a86958347dff842727 /meta/recipes-devtools/python/python3-cryptography/check-memfree.py | |
| parent | 8af946e718317b1a47cf1a8a78938ba55f992cb8 (diff) | |
| download | poky-c6f79207f8183eb3ec366dff39df070563e0e6e2.tar.gz | |
python3-cryptography: move from meta-python
* 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
(From OE-Core rev: 27bd134c899d00d93806ecb0a62ec3f30b1e6ec6)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3-cryptography/check-memfree.py')
| -rwxr-xr-x | meta/recipes-devtools/python/python3-cryptography/check-memfree.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-cryptography/check-memfree.py b/meta/recipes-devtools/python/python3-cryptography/check-memfree.py new file mode 100755 index 0000000000..c111a9074c --- /dev/null +++ b/meta/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 | ||
| 3 | import sys | ||
| 4 | meminfo = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines()) | ||
| 5 | mem_free = meminfo['MemTotal']/1024./1024. | ||
| 6 | if mem_free < 2.: | ||
| 7 | raise RuntimeError("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free)) | ||
| 8 | sys.exit(1) | ||
| 9 | else: | ||
| 10 | print("Free memory: {:.3f} GB".format(mem_free)) | ||
