Skip to content

Commit c8717ed

Browse files
committed
fix: path issue when loading jinja template
1 parent 5782cf0 commit c8717ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mutahunter/core/report.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Any, Dict, List
77

88
from jinja2 import Environment, FileSystemLoader
9+
from importlib import resources
910

1011
from mutahunter.core.db import MutationDatabase
1112
from mutahunter.core.logger import logger
@@ -23,8 +24,9 @@ class MutantReport:
2324
def __init__(self, db: MutationDatabase) -> None:
2425
self.log_file = "logs/_latest/coverage.txt"
2526
self.db = db
27+
2628
self.template_env = Environment(
27-
loader=FileSystemLoader(os.path.join(os.path.dirname(__file__), "html"))
29+
loader=FileSystemLoader(resources.files(__package__).joinpath("html"))
2830
)
2931
os.makedirs("logs/_latest/html", exist_ok=True)
3032

0 commit comments

Comments
 (0)