common.smk: find _helpers.py also if pypsa-eur is used as module

This commit is contained in:
Fabian Neumann 2024-01-04 13:37:35 +01:00
parent 34535bcbff
commit c3bcaee1a2

View File

@ -2,9 +2,14 @@
# #
# SPDX-License-Identifier: MIT # 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 from _helpers import validate_checksum