Releases: glentner/CmdKit
Allow Python 3.9
There were no hard requirements that prevented the use of Python 3.9. The project listed Python 3.10+ because of development dependencies that disallowed 3.9 but we decided to retroactively fix this to allow for wider deployment potential.
Switch to tomli/tomli-w for TOML support
Previously we relied on the toml package for parsing TOML configuration files. However, this package is no longer considered the best provider of such support and is actually now deprecated by some Linux distros. Further, TOML has made its way into the Python standard library (for Python 3.11+, tomllib Therefore it was best to migrate to no dependency at all for Python 3.11+ or use tomli otherwise. For write capabilities we've added tomli-w. Many application have no need to write TOML, so this is an optional dependency.
Proper support for package extras is now provided. To explicitly enable TOML, developers can specify cmdkit[toml]
as a dependency.
Update colorize_usage regex patterns
Minor fixes to address issues with colorize_usage
function.
- Allow 2-letter metavars (e.g., ID)
- Fix pattern matching on special resource names (e.g., stdout vs
--stdout
).
Improve usage and help text formatting
The ansi.py
module holds a collection of regular expressions
that apply automatic formatting to usage and help text with
standard syntax.
This change addresses the following:
- Section headers are generic match on capitalized word at the
start of a line ending in a colon, instead of only matching
on a list of magic words. - Metavars (e.g., FILE, ADDR, PORT) are matched on any all-caps
word not contained by quotes, not preceded by dash; instead of
being a reserved list of magic words. - Match any 4+ character word contained by angle brackets
instead of reserved list of magic words. - Add small list of special list of reserved resources, including
localhost, stdin, stdout, and stderr. - Fix option pattern to include stacked single letter options.
- Fix digit matching to include decimals, this also makes IP
addresses match like numbers (naive but works). - Add to digit matching suffixes for count (K, M, G, T) along
with optional 'b' for bytes, case insensitive.
Fix broken _env and _eval expansion (#21)
Bug fix (Issue #20)
This release includes a fix to a bug in the LogRecord
extension where use of the logging.makeLogRecord
fails because it passes a None
for the name field initially which causes an exception on the relative_name
attribute where it was assumed to be a string.
Color, Logging, and Platform Support
The v2.7.1 release includes major new features along with numerous fixes and improvements.
- Automatic rich colorization of usage text with NO_COLOR support (see no-color.org).
- Automatic platform support honoring conventions for Windows and macOS.
- Extensions to the standard logging module.
- Expose major features in top-level API.
- Various fixes and improvements.
New functionality and some clean up
- Add functionality to
Namespace
andConfiguration
- Fix missing or broken parts of docs
Features and minor fixes
Added whereis
to Namespace
and Configuration
.
Minor Refactoring
2.5.1 Minor Refactoring