Releases: glentner/CmdKit
Fixes and Improvements
- Fix update behavior for Configuration
- Update documentation
- Minor fixes to code correctness
Mutable Namespaces
The original implementation inherited by Namespace only coerced member
mappables to a Namespace on access (read) and would clobber any in-place
changes made to the structure. Now we coerce on set (write) and so
modification works perfectly well.
Fixes, improvements, more flexibility
Minor fixes and improvements to the code. This also includes some refactoring that make it easier to patch behavior. Additions to CI/CD improve automation for the project.
Mypy support
2.2.3 Mypy support w/ py.typed
Group Parameters
This release includes a number of fixes and improvements. The notable feature addition is the ability to now add non-terminating options and flags to an ApplicationGroup
interface and have them available in your applications. All groups along the hierarchy have their option namespaces merged and attached as shared
to the Application class. So adding my_opt
to a parent application group would be accessible from the downline application as self.shared.my_opt
.
New Features, Unit Tests, and Documentation
This release includes core fixes to the Configuration
class and a new factory method for automatically loading configuration files and merging them. Also included is functionality to automatically explode and type-coerce a Namespace
created from environment variables. Finally, an ApplicationGroup
class makes it simple to create a hierarchical CLI without code duplication.
Context Manager Style Applications
Application classes with resources can now define __enter__
and __exit__
methods. Application.main
now initializes the application using a with
statement.
1.0 Release
After testing this in a few big projects it seems appropriate to bump to version 1.
Custom exception handling
This release fixes a bug and adds a new feature.
First, the -v/--version flag behavior from argparse
is fixed via a patch to its version action class and now the VersionOption class that already existed is caught in the main method and takes the proper action.
Second, the Application
class's main
method was made more generalizable. Now, you can define a class-level variable named exceptions
as a dictionary of exception types with handler functions. These handler functions should take the exception instance as its only argument and return an exit status.
Initial Release
0.0.2 version 0.0.2