From c3bcaee1a22a888d2ba1147ed643fbf7607ffa86 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 4 Jan 2024 13:37:35 +0100 Subject: [PATCH] common.smk: find _helpers.py also if pypsa-eur is used as module --- rules/common.smk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rules/common.smk b/rules/common.smk index 44e3a807..0e85b620 100644 --- a/rules/common.smk +++ b/rules/common.smk @@ -2,9 +2,14 @@ # # SPDX-License-Identifier: MIT -import os, sys +import os, sys, glob + +helper_source_path = [match for match in glob.glob('**/_helpers.py', recursive=True)] + +for path in helper_source_path: + path = os.path.dirname(os.path.abspath(path)) + sys.path.insert(0, os.path.abspath(path)) -sys.path.insert(0, os.path.abspath("scripts")) from _helpers import validate_checksum