Had a quick idea for this after speaking with @mkolar about whether or not Conform
should continue when any part of Extraction
has failed.
Goal
To facilitate custom “breakpoints” during a publish, called borders
.
Currently, publishing stops if any plug-in of order 1
throws an exception.
Implementation
import pyblish.api
pyblish.api.border = [1]
In a nutshell, specify at which orders you would like publishing to stop, unless all plug-ins of earlier orders have finished successfully.
In the above example, if any order before 1 fails - i.e. any Selector or Validator - publishing stops.
import pyblish.api
# Evaluate history after Validation and Extraction
pyblish.api.borders = [1, 2]
# ..after Validation, and half-way through Extraction
pyblish.api.borders = [1, 1.5]
Syntax
As an alternative to the above, which doesn’t take into consideration ranges.
requirements.txt syntax
# Any order greater, or equal to, 1
pyblish.api.border = "order>=1"
# Any order greater, or equal to, 1, but less than 2
pyblish.api.border = "order>=1, <2"
# Only consider failures for plug-ins with an order of 3
pyblish.api.border = "order==3"
Future
#143 implements a mechanism to resolve this in a more flexible manner, but would take longer to develop and likely introduce unknown issues of it’s own. border
could work today, without interfering with events in the future.
Thougths?