From e250c79ad0980478a37bbb1ef5fe1ae391198f4a Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 12 Jun 2024 17:25:07 +0200 Subject: [PATCH] Allow framework scripts to import modules from the main project Allow framework scripts to import scripts from the main project as modules, for example config.py. Signed-off-by: Gilles Peskine --- scripts/project_scripts.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/project_scripts.py diff --git a/scripts/project_scripts.py b/scripts/project_scripts.py new file mode 100644 index 000000000..2666c7b10 --- /dev/null +++ b/scripts/project_scripts.py @@ -0,0 +1,17 @@ +"""Add the consuming repository's scripts to the module search path. + +Usage: + + import project_scripts # pylint: disable=unused-import +""" + +# Copyright The Mbed TLS Contributors +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# + +import os +import sys + +sys.path.append(os.path.join(os.path.dirname(__file__), + os.path.pardir, os.path.pardir, + 'scripts'))