diff --git a/adjutant/api/urls.py b/adjutant/api/urls.py index feb00b0..d80e747 100644 --- a/adjutant/api/urls.py +++ b/adjutant/api/urls.py @@ -13,9 +13,6 @@ # under the License. from django.urls import include, re_path -from django.conf import settings - -from rest_framework_swagger.views import get_swagger_view from adjutant.api import views from adjutant.api.views import build_version_details @@ -29,8 +26,3 @@ urlpatterns = [ build_version_details("1.0", "CURRENT", relative_endpoint="v1/") urlpatterns.append(re_path(r"^v1/?$", views_v1.V1VersionEndpoint.as_view())) urlpatterns.append(re_path(r"^v1/", include("adjutant.api.v1.urls"))) - - -if settings.DEBUG: - schema_view = get_swagger_view(title="Adjutant API") - urlpatterns.append(re_path(r"^docs/", schema_view)) diff --git a/adjutant/startup/loading.py b/adjutant/startup/loading.py index 0e603e9..36c3a33 100644 --- a/adjutant/startup/loading.py +++ b/adjutant/startup/loading.py @@ -12,10 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -import pkg_resources +import importlib_metadata as metadata def load_feature_sets(): - for entry_point in pkg_resources.iter_entry_points("adjutant.feature_sets"): + for entry_point in metadata.entry_points(group="adjutant.feature_sets"): feature_set = entry_point.load() feature_set().load() diff --git a/requirements.txt b/requirements.txt index 9463a94..926414f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,3 +16,4 @@ python-octaviaclient>=1.8.0 python-troveclient>=6.0.1 six>=1.12.0 confspirator>=0.2.2 +importlib-metadata>=6.2.1