What changed in pluggy from 0 to 1
6 releases numbered after 0.13.1 up to and including 1.6.0, stable releases only. 0.13.1 and 1.6.0 are the newest stable releases of 0 and 1 we track; this page follows them as new ones ship.
- 3 remove or deprecate something
31 changes across 6 releases
- Add support for deprecating specific hook parameters, or more generally, for issuing a warning whenever a hook implementation requests certain parameters
- Issue a PluggyTeardownRaisedWarning when an old-style hookwrapper raises an exception during teardown
- Add PluginManager.unblock method to unblock a plugin by plugin name
- Pluggy now exposes its typings to static type checkers
- Exported HookImpl as pluggy.HookImpl
- Raise PluginValidationError when registering a hookimpl declared as hookwrapper=True whose function is not a generator function
- Add official support for Python 3.9
- Add specname option to @hookimpl to match hook implementations to specifications using a different name
- Renamed _Result to Result and exported as pluggy.Result
- Renamed _HookRelay to HookRelay and exported as pluggy.HookRelay
- Renamed _HookCaller to HookCaller and exported as pluggy.HookCaller
- Renamed _HookImplOpts to HookimplOpts and exported as pluggy.HookimplOpts
- Renamed _HookSpecOpts to HookspecOpts and exported as pluggy.HookspecOpts
- Some fields and classes are marked Final and @final
- New-style hook wrappers now require an explicit wrapper=True designation in the @hookimpl() decorator
- Fix a regression in pluggy 1.1.0 where using result.get_result() on the same failed Result causes the exception's traceback to get longer and longer
- Correctly pass StopIteration through hook wrappers by resuming with the StopIteration as a normal exception instead of failing with the RuntimeError
- Fix python 3.14 SyntaxError by rearranging code
- PluginManager.get_plugins() no longer returns None for blocked plugins
- Fix HookCaller.call_extra() extra methods getting ordered before everything else in some circumstances
- Fix plugins registering other plugins in a hook when the other plugins implement the same hook itself
- Python 3.8 is no longer supported
- Python 3.7 is no longer supported
- Remove deprecated implprefix support; use HookimplMarker instead
- Remove the deprecated proc argument to call_historic; use result_callback instead
- Remove the _Result.result property; use _Result.get_result() instead
- Remove official support for Python 3.4
- Drop support for Python 2
- Remove official support for Python 3.5
- Mark internal pluggy.callers, pluggy.manager, and pluggy.hooks as private with _ prefix
- Remove legacy __multicall__ recursive hook calling system
Original release notes, newest first
The list above is our reading of these notes; the originals from pluggy are here, one fold per release.
1.6.0
Deprecations and Removals
#556 <https://github.com/pytest-dev/pluggy/issues/556>_: Python 3.8 is no longer supported.
Bug Fixes
-
#504 <https://github.com/pytest-dev/pluggy/issues/504>_: Fix a regression in pluggy 1.1.0 where using :func:result.get_result() <pluggy.Result.get_result>on the same failed :class:~pluggy.Resultcauses the exception's traceback to get longer and longer. -
#544 <https://github.com/pytest-dev/pluggy/issues/544>_: Correctly pass :class:StopIterationthrough hook wrappers.Raising a :class:
StopIterationin a generator triggers a :class:RuntimeError.If the :class:
RuntimeErrorof a generator has the passed in :class:StopIterationas cause resume with that :class:StopIterationas normal exception instead of failing with the :class:RuntimeError. -
#573 <https://github.com/pytest-dev/pluggy/issues/573>_: Fix python 3.14 SyntaxError by rearranging code.
1.5.0
Features
-
#178 <https://github.com/pytest-dev/pluggy/issues/178>_: Add support for deprecating specific hook parameters, or more generally, for issuing a warning whenever a hook implementation requests certain parameters.See :ref:
warn_on_implfor details.
Bug Fixes
#481 <https://github.com/pytest-dev/pluggy/issues/481>_:PluginManager.get_plugins()no longer returnsNonefor blocked plugins.
1.4.0
Features
-
#463 <https://github.com/pytest-dev/pluggy/issues/463>_: A warning :class:~pluggy.PluggyTeardownRaisedWarningis now issued when an old-style hookwrapper raises an exception during teardown. See the warning documentation for more details. -
#471 <https://github.com/pytest-dev/pluggy/issues/471>_: Add :func:PluginManager.unblock <pluggy.PluginManager.unblock>method to unblock a plugin by plugin name.
Bug Fixes
-
#441 <https://github.com/pytest-dev/pluggy/issues/441>_: Fix :func:~pluggy.HookCaller.call_extra()extra methods getting ordered before everything else in some circumstances. Regressed in pluggy 1.1.0. -
#438 <https://github.com/pytest-dev/pluggy/issues/438>_: Fix plugins registering other plugins in a hook when the other plugins implement the same hook itself. Regressed in pluggy 1.1.0.
1.3.0
Deprecations and Removals
#426 <https://github.com/pytest-dev/pluggy/issues/426>_: Python 3.7 is no longer supported.
Features
-
#428 <https://github.com/pytest-dev/pluggy/issues/428>_: Pluggy now exposes its typings to static type checkers.As part of this, the following changes are made:
- Renamed
_ResulttoResult, and exported as :class:pluggy.Result. - Renamed
_HookRelaytoHookRelay, and exported as :class:pluggy.HookRelay. - Renamed
_HookCallertoHookCaller, and exported as :class:pluggy.HookCaller. - Exported
HookImplas :class:pluggy.HookImpl. - Renamed
_HookImplOptstoHookimplOpts, and exported as :class:pluggy.HookimplOpts. - Renamed
_HookSpecOptstoHookspecOpts, and exported as :class:pluggy.HookspecOpts. - Some fields and classes are marked
Finaland@final. - The :ref:
api-referenceis updated to clearly delineate pluggy's public API.
Compatibility aliases are put in place for the renamed types. We do not plan to remove the aliases, but we strongly recommend to only import from
pluggy.*to ensure future compatibility.Please note that pluggy is currently unable to provide strong typing for hook calls, e.g.
pm.hook.my_hook(...), nor to statically check that a hook implementation matches the hook specification's type. - Renamed
1.2.0
Features
#405 <https://github.com/pytest-dev/pluggy/issues/405>_: The new-style hook wrappers, added in the yanked 1.1.0 release, now require an explicitwrapper=Truedesignation in the@hookimpl()decorator.
1.0.0
Deprecations and Removals
-
#116 <https://github.com/pytest-dev/pluggy/issues/116>_: Remove deprecatedimplprefixsupport. Decorate hook implementations using an instance of HookimplMarker instead. The deprecation was announced in release0.7.0. -
#120 <https://github.com/pytest-dev/pluggy/issues/120>_: Remove the deprecatedprocargument tocall_historic. Useresult_callbackinstead, which has the same behavior. The deprecation was announced in release0.7.0. -
#265 <https://github.com/pytest-dev/pluggy/issues/265>_: Remove the_Result.resultproperty. Use_Result.get_result()instead. Note that unlikeresult,get_result()raises the exception if the hook raised. The deprecation was announced in release0.6.0. -
#267 <https://github.com/pytest-dev/pluggy/issues/267>_: Remove official support for Python 3.4. -
#272 <https://github.com/pytest-dev/pluggy/issues/272>_: Dropped support for Python 2. Continue to use pluggy 0.13.x for Python 2 support. -
#308 <https://github.com/pytest-dev/pluggy/issues/308>_: Remove official support for Python 3.5. -
#313 <https://github.com/pytest-dev/pluggy/issues/313>_: The internalpluggy.callers,pluggy.managerandpluggy.hooksare now explicitly marked private by a_prefix (e.g.pluggy._callers). Only API exported by the top-levelpluggymodule is considered public. -
#59 <https://github.com/pytest-dev/pluggy/issues/59>_: Remove legacy__multicall__recursive hook calling system. The deprecation was announced in release0.5.0.
Features
-
#282 <https://github.com/pytest-dev/pluggy/issues/282>_: When registering a hookimpl which is declared ashookwrapper=Truebut whose function is not a generator function, a :class:~pluggy.PluginValidationErrorexception is now raised.Previously this problem would cause an error only later, when calling the hook.
In the unlikely case that you have a hookwrapper that returns a generator instead of yielding directly, for example:
.. code-block:: python
def my_hook_implementation(arg): print("before") yield print("after") @hookimpl(hookwrapper=True) def my_hook(arg): return my_hook_implementation(arg)change it to use
yield frominstead:.. code-block:: python
@hookimpl(hookwrapper=True) def my_hook(arg): yield from my_hook_implementation(arg) -
#309 <https://github.com/pytest-dev/pluggy/issues/309>_: Add official support for Python 3.9. -
#251 <https://github.com/pytest-dev/pluggy/issues/251>_: Addspecnameoption to@hookimpl. Ifspecnameis provided, it will be used instead of the function name when matching this hook implementation to a hook specification during registration (allowing a plugin to register a hook implementation that was not named the same thing as the corresponding@hookspec).