- Downloads
BREAKING CHANGES!
This commit changes the way built-in actions are accessed. For better maintainability and extensibility, the actions are now contained in their own module. You will no longer access them via CellModifier.Actions.ACTION_NAME but instead you can directly import the `actions` module and access the actions via `actions.action_name`. This change is breaking and requires you to update your code accordingly. The rationale for this change is that it allows for easier extension of the actions and better separation of concerns. The code for the CellModifier is now significantly shorter and better to maintain. The same goes for the actions. It has also finally made it possible to dynamically load them. Before we had to maintain a list of available actions because Enum doesn't list members that link to a Callable. This also lays the ground stone for serialization and deserialization of custom actions. For that I am still somewhat unsure of the right way to do it. The only secure way I could imagine would be to sign the pickled functions with a secret key and refuse to load them if the signature no longer matches. That would be optional and without the feature is disabled. - The tests have been adjusted - The examples have been adjusted - The documentation has been adjusted
Showing
- examples/json_based/create_json_state.py 5 additions, 4 deletionsexamples/json_based/create_json_state.py
- examples/multi_module/definitions/desired_states/common.py 2 additions, 1 deletionexamples/multi_module/definitions/desired_states/common.py
- examples/multi_module/definitions/desired_states/remove_solutions.py 4 additions, 5 deletions...lti_module/definitions/desired_states/remove_solutions.py
- examples/python_based/README.md 5 additions, 4 deletionsexamples/python_based/README.md
- examples/python_based/process_notebooks.py 5 additions, 4 deletionsexamples/python_based/process_notebooks.py
- src/Notebook_Processor/__init__.py 1 addition, 0 deletionssrc/Notebook_Processor/__init__.py
- src/Notebook_Processor/desired_state/actions/__init__.py 43 additions, 0 deletionssrc/Notebook_Processor/desired_state/actions/__init__.py
- src/Notebook_Processor/desired_state/actions/action_clear.py 40 additions, 0 deletionssrc/Notebook_Processor/desired_state/actions/action_clear.py
- src/Notebook_Processor/desired_state/actions/action_clear_outputs.py 41 additions, 0 deletions...k_Processor/desired_state/actions/action_clear_outputs.py
- src/Notebook_Processor/desired_state/actions/action_delete.py 20 additions, 0 deletions...Notebook_Processor/desired_state/actions/action_delete.py
- src/Notebook_Processor/desired_state/actions/action_replace_fields.py 30 additions, 0 deletions..._Processor/desired_state/actions/action_replace_fields.py
- src/Notebook_Processor/desired_state/actions/action_replace_in_source.py 23 additions, 0 deletions...ocessor/desired_state/actions/action_replace_in_source.py
- src/Notebook_Processor/desired_state/actions/action_report.py 28 additions, 0 deletions...Notebook_Processor/desired_state/actions/action_report.py
- src/Notebook_Processor/desired_state/actions/action_update_metadata.py 26 additions, 0 deletions...Processor/desired_state/actions/action_update_metadata.py
- src/Notebook_Processor/desired_state/cell_modifier.py 31 additions, 205 deletionssrc/Notebook_Processor/desired_state/cell_modifier.py
- tests/conftest.py 12 additions, 5 deletionstests/conftest.py
- tests/desired_state/test_cell_modifier.py 13 additions, 34 deletionstests/desired_state/test_cell_modifier.py
- tests/desired_state/test_predefined_action.py 38 additions, 33 deletionstests/desired_state/test_predefined_action.py
Loading
Please sign in to comment