Replace pkg_resources with importlib, remove debug docs.
As of Python 3.8, importlib.metadata is the provisional replacement for pkg_resources which depended on setuptools. In python 3.10 this is no longer provisional and supersedes pkg_resources with the same functionality. Also remove rest_framework_swagger which provides the `/docs/` endpoint temporarily. The library is end of life and should be replaced with drf-yasg or similar. Ref: https://importlib-metadata.readthedocs.io/en/latest/migration.html Ref: https://docs.python.org/3/library/importlib.metadata.html Change-Id: I102e94c8172f6ea660814dd8fcd44ed8239b2e67
This commit is contained in:
parent
b8c1194f90
commit
7cdf620889
@ -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))
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user