Use pyface.undo imports in apptools.undo instead of redefining the classes#272
Merged
Merged
Conversation
added 3 commits
January 8, 2021 16:58
instead of simply raising a deprecation warning and redefining the modules/classes Note that the tests have been removed as this module is now simply a stub, exposing the functionality in pyface.undo, and will be removed in the future modified: apptools/undo/abstract_command.py modified: apptools/undo/action/abstract_command_stack_action.py modified: apptools/undo/action/api.py modified: apptools/undo/action/command_action.py modified: apptools/undo/action/redo_action.py modified: apptools/undo/action/undo_action.py modified: apptools/undo/api.py modified: apptools/undo/command_stack.py modified: apptools/undo/i_command.py modified: apptools/undo/i_command_stack.py modified: apptools/undo/i_undo_manager.py deleted: apptools/undo/tests/__init__.py deleted: apptools/undo/tests/test_command_stack.py deleted: apptools/undo/tests/testing_commands.py modified: apptools/undo/undo_manager.py
new file: docs/releases/upcoming/272.deprecation.rst
Ignore F401 errors anywhere in apptools.undo.* modified: apptools/undo/api.py modified: setup.cfg
1 task
kitchoi
reviewed
Jan 13, 2021
| """ This is called by the command stack to undo the command. """ | ||
|
|
||
| raise NotImplementedError | ||
| from pyface.undo.api import AbstractCommand |
Contributor
There was a problem hiding this comment.
For maintaining backward compatibility, I'd think the safest thing to do would be from pyface.undo.abstract_command import *, assuming the module is moved to pyface as is. e.g. this breaks from apptools.undo.abstract_command import ICommand. We believe no one does that, but it costs little to do the safer approach. 🤞 this does not break anything.
Contributor
There was a problem hiding this comment.
@rahulporuri should we make this change before I push ahead with the release?
Contributor
Author
There was a problem hiding this comment.
i'd actually prefer breaking such imports now - which will make the eventual transition to pyface trivial - and cleaner/better because those imports are antipatterns anyway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #271
This PR imports the relevant classes from
pyface.undoandpyface.undo.actioninstead of redefining the classes. Where possible, we import frompyface.undo.apiandpyface.undo.action.api.Note that the tests have been removed as this module is now simply a stub, exposing the functionality in
pyface.undo, and will be removed in the future.Checklist