Refactor CommandLine
command registration
#1611
Open
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: #1610
Refactors
CommandLine
internals so that it's easier to plug custom commands into the cli, in addition to the builtinsalembic.command
.No public interface changes whatsoever.
The topic was somewhat discussed here #1456
Description
The point from the linked discussion still applies - this does not enable any kind of plugin system, one would still need to have their own subclass of
CommandLine
and call it from their own script. However, the implementation of such a subclass should be much cleaner now. I would expect it to look like so:Checklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>
in the commit messageThis is purely internal refactoring, so no new tests are required. For extra confidence I:
tox
locally;alembic --help
before and after this change and made sure there was no diff.Have a nice day!