Skip to content

v0.31.0 — Annotation-driven!

Compare
Choose a tag to compare
@neithere neithere released this 30 Dec 18:21
· 30 commits to master since this release

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() and argh.dispatch_commands()
    now accept a new parameter old_name_mapping_policy.

Deprecated:

  • the namespace argument in argh.dispatch() and argh.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