diff --git a/tutorindigo/plugin.py b/tutorindigo/plugin.py index 0e8edf73d..24859de1f 100644 --- a/tutorindigo/plugin.py +++ b/tutorindigo/plugin.py @@ -3,7 +3,7 @@ import os import typing as t -import pkg_resources +import importlib_resources from tutor import hooks from tutor.__about__ import __version_suffix__ @@ -39,8 +39,11 @@ } # Theme templates -hooks.Filters.ENV_TEMPLATE_ROOTS.add_item( - pkg_resources.resource_filename("tutorindigo", "templates") +hooks.Filters.ENV_TEMPLATE_ROOTS.add_items( + [ + # Root paths for template files, relative to the project root. + str(importlib_resources.files("tutorindigo") / "templates"), + ] ) # This is where the theme is rendered in the openedx build directory hooks.Filters.ENV_TEMPLATE_TARGETS.add_items( @@ -57,7 +60,7 @@ # init script: set theme automatically with open( os.path.join( - pkg_resources.resource_filename("tutorindigo", "templates"), + str(importlib_resources.files("tutorindigo") / "templates"), "indigo", "tasks", "init.sh",