Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
add step to validate preprocessors that relies on nbformat 4.4 #645
This PR will break not pass on travis until jupyter/nbformat#103 is changed.
We had thought (in our discussion in #643) that preprocessors currently would not be able to violate the NotebookNode format… turns out, that isn't the case!
Lo, behold the
class PizzaPreprocessor(Preprocessor): """Simple preprocessor that adds a 'pizza' entry to the NotebookNode. Used to test Exporter. """ def preprocess(self, nb, resources): nb['pizza'] = 'cheese' return nb, resources
which is part of our
This is definitely not a valid attribute, so it seems we've not been strict about enforcing the "nb→nb" aspect of Preprocessors for a while.
That would mean that the PizzaPreprocessor would now be ok (at least as far as the intermediate representation goes), as well as the
It also would enforce this constraint on 3rd-party extensions relying on the native preprocessor support in the core Exporter (which is probably going to break some extensions but we probably want to know what extensions actually cause non-valid notebooks to be written).