Argh

Latest version: v0.31.2

Safety actively analyzes 613649 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.31.2

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: https://github.com/neithere/argh/compare/v0.31.1...v0.31.2

0.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**: https://github.com/neithere/argh/compare/v0.31.0...v0.31.1

0.31.0

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 https://github.com/neithere/argh/pull/211
* Support realtime output through a pipe (fixes 145) by neithere in https://github.com/neithere/argh/pull/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**: https://github.com/neithere/argh/compare/v0.30.5...v0.31.0

0.30.5

What's Changed
* fix: nargs + list as default value (212) by neithere in https://github.com/neithere/argh/pull/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**: https://github.com/neithere/argh/compare/v0.30.4...v0.30.5

Please refer to the official changelog for more details: https://argh.readthedocs.io/en/latest/changes.html

0.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**: https://github.com/neithere/argh/compare/v0.30.3...v0.30.4

0.30.3

What's Changed
* fix: regression — `arg` deco failing with underscore in positional arg name (fixes 208) by neithere in https://github.com/neithere/argh/pull/209 (thanks to kaetir for a report with a reproducible example)


**Full Changelog**: https://github.com/neithere/argh/compare/v0.30.2...v0.30.3

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.