From ba3e92d92918e620c77e23d0442608a1a678a061 Mon Sep 17 00:00:00 2001 From: Chloe Herman <60228108+cherman2@users.noreply.github.com> Date: Fri, 21 Mar 2025 13:15:51 -0700 Subject: MAINT: `pkg_resources` deprecation Co-authored-by: Liz Gehret --- q2templates/_templates.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/q2templates/_templates.py b/q2templates/_templates.py index e6bf159..4023041 100644 --- a/q2templates/_templates.py +++ b/q2templates/_templates.py @@ -8,7 +8,7 @@ import inspect import os -import pkg_resources +import importlib import shutil import tempfile @@ -35,7 +35,7 @@ def render(source_files, output_dir, context=None): src = get_iterable(source_files) # TODO: Hook into qiime.sdk.config.TemporaryDirectory() when it exists temp_dir = tempfile.TemporaryDirectory() - template_data = pkg_resources.resource_filename('q2templates', 'templates') + template_data = importlib.resources.files('q2templates') / 'templates' env = Environment(loader=FileSystemLoader(temp_dir.name), auto_reload=True) shutil.copy2(os.path.join(template_data, 'base.html'), temp_dir.name) -- 2.47.3