Skip to content

Deprecate __multicall__ support #23

Closed

Description

@goodboy

As per the comment in pluggy._MultiCall we should be able to drop the line here. Grepping the pytest sources reveals that only a few spots still reference it.

This change also allows us to remove the recursion induced by _wrapped_call() getting passed _MultiCall.execute. This means we can remove _wrapped_call and simply loop through hookwrapper pre and post yield calls at the beginning and end of execute(). I'd actually be interested to see if contextlib.contextmanager wrapping could be used directly for this.

Activity

  1. RonnyPfannschmidt commented on Sep 13, 2016

    @RonnyPfannschmidt
    Member

    it exists solely for backward compatibility

    at the pytest sprint we discussed that instead of just removing it,
    we should have a separate faster implementation without it and choose based on the hook

    at the pytest sprint we discussed that instead of just removing it,
    we should have a separate faster implementation without it and choose based on the hooks

  2. goodboy commented on Sep 13, 2016

    @goodboy
    ContributorAuthor

    @RonnyPfannschmidt ok so if I implement this where do you want the check for __multicall__ support to be?

  3. RonnyPfannschmidt commented on Sep 14, 2016

    @RonnyPfannschmidt
    Member

    i dont care where it is ^^ it has to work reliable :)

  4. hpk42 commented on Sep 14, 2016

    @hpk42
    Contributor

    I guess it makes sense to check if multicall is used during registering a plugin and mark the hook caller accordingly. On instantiation of PluginManager one should be able to optionally specify a callback which receives information about plugin and hook which uses multicall so a warning can be added.

    Then at hook calling time we can switch between the two implementations. The current one would be used for when multicall is used.

  5. hpk42 commented on Nov 11, 2016

    @hpk42
    Contributor

    Also it makes sense to get rid of the last pytest usages of __multicall__ instances besides.

  6. RonnyPfannschmidt commented on Nov 11, 2016

    @RonnyPfannschmidt
    Member

    we should probably put the deprecation-warning into pluggy using python warnings themselfes
    as for pytest itself, a quick grin showed that only the testsuite has a few useages leftover

  7. nicoddemus commented on Nov 11, 2016

    @nicoddemus
    Member

    Oh really? I swear I have removed those. 😬

  8. goodboy commented on Nov 11, 2016

    @goodboy
    ContributorAuthor

    Gonna try and hack on this over the weekend.

  9. goodboy commented on Feb 16, 2017

    @goodboy
    ContributorAuthor

    @hpk42 I actually started this but it turns out the way that tracing is accomplished kind of makes it a bit tricky with _MultiCall being statically assigned in the PluginManager._inner_hookexec lambda.

    So I wanted to propose:

    • each _HookCaller is instantiated with it's own _MultiCall and we revert to a LegacyMultiCall only when '__multicall__' is detected in a hookimpl signature (i.e. when _HookCaller._add_hookimpl() is called)
    • make tracing enabled per _HookCaller instead of globally
      • we can still keep the PluginManager.enable_tracing() method (which could now also accept an optional hookname arg) that does it globally but internally it will enable tracing on each _HookCaller.
    • this should let us get rid of the confusing indirection of PluginManager._hookexec() and _inner_hookexec because multicall objects will be instantiated once per _HookCaller instead of on every hook call.

    Let me know what you think.

  10. self-assigned this
    on Apr 22, 2017
  11. changed the title [-]Drop __multicall__ support[/-] [+]Deprecate __multicall__ support[/+] on Jul 9, 2017
  12. added a commit that references this issue on Jul 10, 2017
    845c502
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions