Skip to content

Releases: neithere/argh

v0.31.3

13 Jul 17:54
Compare
Choose a tag to compare

What's Changed

New Contributors

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

24 Jan 21:29
Compare
Choose a tag to compare

What's Changed

Bugs fixed:

  • broken support for Optional[List] (but not Optional[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

19 Jan 16:54
Compare
Choose a tag to compare

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:

Enhancements:

  • cleaned up the README, rearranged other documentation.

Full diff: v0.31.0...v0.31.1

v0.31.0 — Annotation-driven!

30 Dec 18:21
Compare
Choose a tag to compare

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

v0.30.5

25 Dec 22:04
1d03e1b
Compare
Choose a tag to compare

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

04 Nov 17:04
6d9f96f
Compare
Choose a tag to compare

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

30 Oct 21:32
17d3365
Compare
Choose a tag to compare

What's Changed

  • fix: regression — @arg deco failing with underscore in positional arg name (fixes #208) by @neithere in #209 (thanks to @kaetir for a report with a reproducible example)

Full Changelog: v0.30.2...v0.30.3

v0.30.2

24 Oct 21:18
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.30.1...v0.30.2

v0.30.1

23 Oct 18:37
Compare
Choose a tag to compare

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

21 Oct 20:59
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.29.4...v0.30.0