Issue
Title: [v2] Implement LazyCommand for deferring modules until their commands are invoked, and make PrefixTrie public
Description
Issue #, if available:
- Contributes to #9011.
Notes:
- This PR is part of an ongoing effort to reduce AWS CLI initialization time by lazily deferring plugins until they are needed. This PR makes an existing PrefixTrie implementation public, which will be used in a future PR to efficiently model a plugin event-dependency registry. Also, it implements
LazyCommand, which will be used in a future PR to automatically defer plugin imports for plugins that add custom commands to AWS CLI.
Description of changes:
- Switched PrefixTrie from a private interface to a public interface (i.e. rename
_PrefixTrietoPrefixTrie). - Implemented unit tests for the
PrefixTrieclass. - Implemented new
LazyCommandclass, which can wrapCLICommandinstances and defer importing or invoking them until the command is called. - Implemented unit and functional tests for the
LazyCommandclass.
Description of tests:
- Successfully ran all test suites and pre-production build workflow (see GitHub CI).
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Task
Modify the repository so that the issue described above is resolved. The repository is checked out at base commit f3bfa35d88a7. Edit files in place; the verifier captures your changes via git diff and scores them against an oracle patch using SWE-RL-style diff-similarity reward.