Skip to content

Commit 87485a3

Browse files
Add requirement on Jinja to integrate drivers
Driver implementers need to regenerate wrappers. This will use Jinja2 as discussed in #5067 (comment) On the development branch, driver integration is always needed to generate the driver wrapper and thus to build the library, so this requirement applies to everyone, not just driver implementers. In releases, we plan to include a default driver wrapper with support for basic use cases only, meaning that the line `-r driver.requirements.txt` should be removed from `basic.requirements.txt` in releases. Signed-off-by: Gilles Peskine <[email protected]>
1 parent 9c82cd9 commit 87485a3

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ The source code of Mbed TLS includes some files that are automatically generated
5959
The following tools are required:
6060

6161
* Perl, for some library source files and for Visual Studio build files.
62-
* Python 3, for some sample programs and test data.
62+
* Python 3 and some Python packages, for some library source files, sample programs and test data. To install the necessary packages, run
63+
```
64+
python -m pip install -r scripts/basic.requirements.txt
65+
```
6366
* A C compiler for the host platform, for some test data.
6467
6568
If you are cross-compiling, you must set the `CC` environment variable to a C compiler for the host platform when generating the configuration-independent files.

scripts/basic.requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Python modules required to build Mbed TLS in ordinary conditions.
2+
3+
# Required to (re-)generate source files. Not needed if the generated source
4+
# files are already present and up-to-date.
5+
-r driver.requirements.txt

scripts/ci.requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Python package requirements for Mbed TLS testing.
22

3+
-r driver.requirements.txt
4+
35
# Use a known version of Pylint, because new versions tend to add warnings
46
# that could start rejecting our code.
57
# 2.4.4 is the version in Ubuntu 20.04. It supports Python >=3.5.

scripts/driver.requirements.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Python package requirements for driver implementers.
2+
3+
# Use the version of Jinja that's in Ubuntu 20.04.
4+
# See https://github.com/ARMmbed/mbedtls/pull/5067#discussion_r738794607 .
5+
# Note that Jinja2 3.0 drops support for Python 3.5, so we need 2.x.
6+
Jinja2 >= 2.10.1
7+
# Jinja2 >=2.10, <<3.0 needs a separate package for type annotations
8+
types-Jinja2
9+

0 commit comments

Comments
 (0)