fix: replace pkg_resources with importlib.resources (#36213)

This commit is contained in:
Irtaza Akram
2025-02-13 17:43:07 +05:00
committed by GitHub
parent 5623b36e55
commit a8a8ae3286
12 changed files with 45 additions and 61 deletions

View File

@@ -1,7 +1,7 @@
"""
Lookup list of installed XBlocks, to aid XBlock developers
"""
import pkg_resources
from importlib.metadata import entry_points
def get_without_builtins():
@@ -12,11 +12,10 @@ def get_without_builtins():
"""
xblocks = [
entry_point.name
for entry_point in pkg_resources.iter_entry_points('xblock.v1')
if not entry_point.module_name.startswith('xmodule')
for entry_point in entry_points(group='xblock.v1')
if not entry_point.value.startswith('xmodule')
]
xblocks = sorted(xblocks)
return xblocks
return sorted(xblocks)
def main():