-
Notifications
You must be signed in to change notification settings - Fork 59
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
Pyblish fails when it tries to process InstancePlugin with typo process argument "instance" #350
Comments
Transferred this from Traceback (most recent call last):
File "<console>", line 1, in <module>
File "D:\git_pipeline\avalon\development\git\pyblish-base\pyblish\util.py", line 193, in collect
for result in collect_iter(context, plugins, targets):
File "D:\git_pipeline\avalon\development\git\pyblish-base\pyblish\util.py", line 252, in collect_iter
context, plugins, targets):
File "D:\git_pipeline\avalon\development\git\pyblish-base\pyblish\util.py", line 300, in _convenience_iter
for result in publish_iter(context, plugins, targets):
File "D:\git_pipeline\avalon\development\git\pyblish-base\pyblish\util.py", line 119, in publish_iter
result = plugin.process(Plugin, context, instance)
File "D:\git_pipeline\avalon\development\git\pyblish-base\pyblish\plugin.py", line 460, in process
result = __explicit_process(plugin, context, instance, action)
File "D:\git_pipeline\avalon\development\git\pyblish-base\pyblish\plugin.py", line 479, in __explicit_process
raise AssertionError("Cannot process an InstancePlugin without an "
AssertionError: Cannot process an InstancePlugin without an instance. This is a bug Tested with the above example plug-ins and running the following: import pyblish.util
pyblish.util.collect() |
moving your repro steps all in one block of code: import pyblish.api
import pyblish.util
class Collector(pyblish.api.InstancePlugin):
order = pyblish.api.CollectorOrder
def process(self, context):
pass
pyblish.api.register_plugin(Collector)
pyblish.util.collect() prints:
|
would simply changing raise AssertionError("Cannot process an InstancePlugin without an ""instance. This is a bug." ) to raise AssertionError("Cannot process an InstancePlugin without an ""instance. This is a bug. Affected plugin:" + str(plugin)) be enough to resolve this? |
Issue
Whenever you implement a
pyblish.api.InstancePlugin
with aprocess
method that does not have the argumentinstance
but it's written differently/wrong then Pyblish QML will raise the following assertion error:For example, the following will reproduce this error:
Notice how the argument is
wrong
as opposed toinstance
.Similarly
context
fails on anInstancePlugin
too with the same error:Proposal
It would be great if the error would be resolved into a message describing which plug-in is faulty with some information for the developer on how to potentially resolve it.
Reference:
I've also tried to reproduce the other way around with
pyblish.api.ContextPlugin
but it doesn't run into the same issue, however does have an issue of its own which should be a separate issue than this, see pyblish/pyblish-qml#339.The text was updated successfully, but these errors were encountered: