@@ -40,14 +40,20 @@ class PluginManager(object):
40
40
"""
41
41
42
42
def __init__ (self , project_name , implprefix = None ):
43
- """ if implprefix is given implementation functions
43
+ """If `` implprefix`` is given implementation functions
44
44
will be recognized if their name matches the implprefix. """
45
45
self .project_name = project_name
46
46
self ._name2plugin = {}
47
47
self ._plugin2hookcallers = {}
48
48
self ._plugin_distinfo = []
49
49
self .trace = _tracing .TagTracer ().get ("pluginmanage" )
50
50
self .hook = _HookRelay (self .trace .root .get ("hook" ))
51
+ if implprefix is not None :
52
+ warnings .warn (
53
+ "Support for the `implprefix` arg is now deprecated and will "
54
+ "be removed in an upcoming release. Please use HookimplMarker." ,
55
+ DeprecationWarning
56
+ )
51
57
self ._implprefix = implprefix
52
58
self ._inner_hookexec = lambda hook , methods , kwargs : \
53
59
hook .multicall (
@@ -106,7 +112,14 @@ def parse_hookimpl_opts(self, plugin, name):
106
112
if res is not None and not isinstance (res , dict ):
107
113
# false positive
108
114
res = None
115
+ # TODO: remove when we drop implprefix in 1.0
109
116
elif res is None and self ._implprefix and name .startswith (self ._implprefix ):
117
+ _warn_for_function (
118
+ DeprecationWarning (
119
+ "The `implprefix` system is deprecated please decorate "
120
+ "this function using an instance of HookimplMarker." ),
121
+ method
122
+ )
110
123
res = {}
111
124
return res
112
125
0 commit comments