Skip to content

Commit ab54e0e

Browse files
Add Python requirements from framework/util
Any `all.sh` component that runs a script that requires a more recent version of Python must have a `support_xxx` function that checks for the requisite Python version or package. At this time, there is no such requirement yet in the mbedtls repository. The directory `framework/util` is not yet checked by `pylint` or `mypy`, because we use older versions of these tools that don't work well with modern Python versions. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
1 parent 2f718ab commit ab54e0e

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

scripts/ci.requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ cryptography >= 35.0.0; platform_system == 'Linux'
2626
# For building `framework/data_files/server9-bad-saltlen.crt` and check python
2727
# files.
2828
asn1crypto; platform_system == 'Linux'
29+
30+
# More requirements for scripts in the framework that might not work in
31+
# older versions of Python. Note that requirements that are not available
32+
# in the oldest version of Python on our CI must be annodated with
33+
# "python >= ...".
34+
-r ../framework/util/requirements.txt

tests/scripts/components-basic-checks.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ component_check_recursion () {
1616
./framework/scripts/recursion.pl ${BUILTIN_SRC_PATH}/*.c
1717
}
1818

19+
support_check_generated_files () {
20+
# Add requirements on the Python installation here for
21+
# the sake of check_committed_generated_files.py in mbedtls.
22+
#
23+
# Check the Python version, not the presence of the package,
24+
# because the CI runs `all.sh --list-components` outside of the
25+
# venv that has our desired packages.
26+
:
27+
}
28+
1929
component_check_generated_files () {
2030
msg "Check make_generated_files.py consistency"
2131
$MAKE_COMMAND neat

0 commit comments

Comments
 (0)