Skip to content

Commit

Permalink
Deprepate implprefix arg to PluginManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Goodlet committed May 18, 2018
1 parent 119836b commit f8518d8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pluggy/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ class PluginManager(object):
"""

def __init__(self, project_name, implprefix=None):
""" if implprefix is given implementation functions
"""If ``implprefix`` is given implementation functions
will be recognized if their name matches the implprefix. """
self.project_name = project_name
self._name2plugin = {}
self._plugin2hookcallers = {}
self._plugin_distinfo = []
self.trace = _tracing.TagTracer().get("pluginmanage")
self.hook = _HookRelay(self.trace.root.get("hook"))
if implprefix is not None:
warnings.warn(
"Support for the `implprefix` arg is now deprecated and will "
"be removed in an upcoming release.",
DeprecationWarning
)
self._implprefix = implprefix
self._inner_hookexec = lambda hook, methods, kwargs: \
hook.multicall(
Expand Down Expand Up @@ -106,6 +112,7 @@ def parse_hookimpl_opts(self, plugin, name):
if res is not None and not isinstance(res, dict):
# false positive
res = None
# TODO: remove when we drop implprefix in 1.0
elif res is None and self._implprefix and name.startswith(self._implprefix):
res = {}
return res
Expand Down

0 comments on commit f8518d8

Please sign in to comment.