Migrate from pkg_resources to importlib (#3232)

This commit is contained in:
Raphael Michel
2023-04-18 12:46:13 +02:00
committed by GitHub
parent ff86fcf000
commit 2427421945
4 changed files with 30 additions and 31 deletions
+5 -5
View File
@@ -41,9 +41,9 @@ from urllib.parse import urlparse
from json import loads
import django.conf.locale
import importlib_metadata as metadata
from django.utils.crypto import get_random_string
from kombu import Queue
from pkg_resources import iter_entry_points
from pycountry import currencies
from . import __version__
@@ -401,11 +401,11 @@ except ImportError:
pass
PLUGINS = []
for entry_point in iter_entry_points(group='pretix.plugin', name=None):
if entry_point.module_name in PRETIX_PLUGINS_EXCLUDE:
for entry_point in metadata.entry_points(group='pretix.plugin'):
if entry_point.module in PRETIX_PLUGINS_EXCLUDE:
continue
PLUGINS.append(entry_point.module_name)
INSTALLED_APPS.append(entry_point.module_name)
PLUGINS.append(entry_point.module)
INSTALLED_APPS.append(entry_point.module)
HIJACK_PERMISSION_CHECK = "hijack.permissions.superusers_and_staff"
HIJACK_INSERT_BEFORE = None