From 47adcbfde65a1fefef580818988e5a2d832ca342 Mon Sep 17 00:00:00 2001 From: Abdullah Qureshi <111448185+arbimaq@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:53:42 +0500 Subject: [PATCH] chore: migrate to importlib --- code_annotations/contrib/config/__init__.py | 22 +++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/code_annotations/contrib/config/__init__.py b/code_annotations/contrib/config/__init__.py index 3e83f7a..65e9338 100644 --- a/code_annotations/contrib/config/__init__.py +++ b/code_annotations/contrib/config/__init__.py @@ -3,17 +3,13 @@ """ import os -import pkg_resources +import importlib_resources -FEATURE_TOGGLE_ANNOTATIONS_CONFIG_PATH = pkg_resources.resource_filename( - "code_annotations", - os.path.join("contrib", "config", "feature_toggle_annotations.yaml"), -) -SETTING_ANNOTATIONS_CONFIG_PATH = pkg_resources.resource_filename( - "code_annotations", - os.path.join("contrib", "config", "setting_annotations.yaml"), -) -OPENEDX_EVENTS_ANNOTATIONS_CONFIG_PATH = pkg_resources.resource_filename( - "code_annotations", - os.path.join("contrib", "config", "openedx_events_annotations.yaml"), -) +FEATURE_TOGGLE_ANNOTATIONS_CONFIG_PATH = importlib_resources.files( + "code_annotations") / os.path.join("contrib", "config", "feature_toggle_annotations.yaml") + +SETTING_ANNOTATIONS_CONFIG_PATH = importlib_resources.files( + "code_annotations") / os.path.join("contrib", "config", "setting_annotations.yaml") + +OPENEDX_EVENTS_ANNOTATIONS_CONFIG_PATH = importlib_resources.files( + "code_annotations") / os.path.join("contrib", "config", "openedx_events_annotations.yaml")