Releases: neithere/argh
v0.31.3
What's Changed
- Fix type annotation of
errors
inwrap_errors
by @laazy in #229 - fix: exposing func arg in CLI under a different name via deco (fixes #224) by @neithere in #230
- fix: tests were failing under Python 3.13 by @neithere (reported by @mgorny in #228)
- Docs update in similar.rst by @harkabeeparolus in #221
New Contributors
- @harkabeeparolus made their first contribution in #221
- @laazy made their first contribution in #229
Full changelog: https://argh.readthedocs.io/en/latest/changes.html#version-0-31-3-2024-07-13
Full diff: v0.31.2...v0.31.3
v0.31.2
What's Changed
Bugs fixed:
- broken support for
Optional[List]
(but notOptional[list]
), a narrower case of the problem fixed earlier (issue #216) by @neithere, thanks to @thorwhalen
Full changelog: https://argh.readthedocs.io/en/latest/changes.html
Full diff: v0.31.1...v0.31.2
v0.31.1
This text is a brief summary of the full changelog entry: https://argh.readthedocs.io/en/latest/changes.html#version-0-31-1-2024-01-19
What's Changed
Bugs fixed:
- broken support for type alias
List
(issue #216), thanks to @thorwhalen.
Enhancements:
- cleaned up the README, rearranged other documentation.
Full diff: v0.31.0...v0.31.1
v0.31.0 — Annotation-driven!
What's Changed
This release is a major step forward for Argh. It paves the way to a fully annotations-driven approach where decorators will remain a mere legacy.
This text is a brief summary of the full changelog entry: https://argh.readthedocs.io/en/latest/changes.html#version-0-31-0-2023-12-30
Breaking changes:
- The typing hints introspection feature is automatically enabled for any command (function) which does not have any arguments specified via
@arg
decorator. - A small change in the legacy argument mapping policy
BY_NAME_IF_HAS_DEFAULT
concerning the order of variadic positional vs. keyword-only arguments. - Removed the previously deprecated decorator
@expects_obj
.
Enhancements:
- Type hints: basic usage to infer argument types (fixes #203) by @neithere in #211
- Support realtime output through a pipe (fixes #145) by @neithere in #202
- High-level functions
argh.dispatch_command()
andargh.dispatch_commands()
now accept a new parameterold_name_mapping_policy
.
Deprecated:
- the
namespace
argument inargh.dispatch()
andargh.parse_and_resolve()
.
Rationale: continued API cleanup. It's already possible to mutate the
namespace object between parsing and calling the endpoint; it's unlikely that
anyone would need to specify a custom namespace class or pre-populate it
before parsing. Please file an issue if you have a valid use case.
Other changes:
- Refactoring.
Full Diff: v0.30.5...v0.31.0
v0.30.5
What's Changed
- fix: nargs + list as default value (#212) by @neithere in #213
(thanks to @pioio for bug report) - feat: argspec guessing: if
nargs
is not specified but the default value is a list,nargs="*"
is assumed and passed to argparse.
Full Changelog: v0.30.4...v0.30.5
Please refer to the official changelog for more details: https://argh.readthedocs.io/en/latest/changes.html
v0.30.4
What's Changed
There were complaints about the lack of a deprecation cycle for the legacy name
mapping policy. This version addresses the issue:
-
The handling introduced in v.0.30.2 (raising an exception for clarity)
is retained for cases when no name mapping policy is specified but function
signature contains defaults in non-kwonly args and kwonly args are also
defined::def main(alpha, beta=1, *, gamma=2): # error — explicit policy required
In a similar case but when kwonly args are not defined Argh now assumes
the legacy name mapping policy (BY_NAME_IF_HAS_DEFAULT
) and merely issues
a deprecation warning with the same message as the exception mentioned above::def main(alpha, beta=2): # `[-b BETA] alpha` + DeprecationWarning
This ensures that most of the old scripts still work the same way despite the
new policy being used by default and enforced in cases when it's impossible
to resolve the mapping conflict.Please note that this "soft" handling is to be removed in version v0.33
(or v1.0 if the former is not deemed necessary). The new name mapping policy
will be used by default without warnings, like in v0.30.
— by @neithere
Full Changelog: v0.30.3...v0.30.4
v0.30.3
v0.30.2
What's Changed
- fix: raise exception for non-migrated commands (fixes #206) by @neithere (reported and valuable feedback given by @valentin-feron) in #207
Full Changelog: v0.30.1...v0.30.2
v0.30.1
What's Changed
Bugs fixed:
- Regression: certain special values in argument default value would cause an exception (#204 reported by @mfussenegger, fixed by @neithere)
Enhancements:
- Improved the tutorial by @neithere
- Added a more informative error message when the reason is likely to be related to the migration from Argh v0.29 to a version with a new argument name mapping policy by @neithere
Other changes:
- Added
py.typed
marker file for PEP-561 by @neithere
Details
Commits: v0.30.0...v0.30.1
Full changelog: https://argh.readthedocs.io/en/latest/changes.html#version-0-30-1
v0.30.0
What's Changed
- Remove previously deprecated code (closes #184) by @neithere in #188
- Type annotations for existing code (closes #185) by @neithere in #189
- Deprecate
help
command alias and@expects_obj
decorator by @neithere in #192 - Document usage with class methods (closes #138) by @neithere in #194
- Remove pre_call, expose finer control over dispatching (re #63) by @neithere in #193
- Add support for Python 3.12 (closes #196) by @neithere in #195
- Refactor assembling module (closes #197) by @neithere in #198
- Keyword-only arguments as options (closes #191) by @neithere in #199
Full Changelog: v0.29.4...v0.30.0