diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index d70d19071..451235d8d 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -43,6 +43,7 @@ jobs: shell: bash - name: Run gempyor tests run: | + export FLEPI_PATH=$(pwd) cd flepimop/gempyor_pkg pytest --exitfirst shell: bash diff --git a/flepimop/gempyor_pkg/src/gempyor/_jinja.py b/flepimop/gempyor_pkg/src/gempyor/_jinja.py index 406c8f2ef..9495996f1 100644 --- a/flepimop/gempyor_pkg/src/gempyor/_jinja.py +++ b/flepimop/gempyor_pkg/src/gempyor/_jinja.py @@ -14,11 +14,18 @@ from tempfile import mkstemp from typing import Any -from jinja2 import Environment, PackageLoader, Template +from jinja2 import Environment, FileSystemLoader, PackageLoader, Template # Globals -_jinja_environment = Environment(loader=PackageLoader("gempyor", "templates")) +try: + _jinja_environment = Environment(loader=PackageLoader("gempyor", "templates")) +except ValueError: + from os.path import dirname + + _jinja_environment = Environment( + loader=FileSystemLoader(dirname(__file__) + "/templates") + ) # Functions