Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requires Pulp plugins to provide version #1106

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES/plugin_api/7930.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Plugins are required to define a ``version`` attribute on their subclass of
``PulpPluginAppConfig``. Starting with pulpcore==3.10, if undefined while Pulp loads, Pulp will
refuse to start.
6 changes: 3 additions & 3 deletions pulpcore/app/apps.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from collections import defaultdict
from gettext import gettext as _
from importlib import import_module
import warnings

from django import apps
from django.core.exceptions import ImproperlyConfigured
from django.db.models.signals import post_migrate
from django.utils.module_loading import module_has_submodule

Expand Down Expand Up @@ -65,11 +65,11 @@ def __init__(self, app_name, app_module):
self.version
except AttributeError:
msg = _(
f"The plugin `{self.label}` is missing a version attribute. Starting with "
"The plugin `{}` is missing a version declaration. Starting with "
"pulpcore==3.10, plugins are required to define their version on the "
"PulpPluginAppConfig subclass."
)
warnings.warn(msg, FutureWarning)
raise ImproperlyConfigured(msg.format(self.label))

# Module containing viewsets eg. <module 'pulp_plugin.app.viewsets'
# from 'pulp_plugin/app/viewsets.py'>. Set by import_viewsets().
Expand Down