Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update argh to 0.31.2 #1078

Closed
wants to merge 1 commit into from
Closed

Conversation

pyup-bot
Copy link
Collaborator

This PR updates argh from 0.26.2 to 0.31.2.

Changelog

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

0.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 https://github.com/neithere/argh/pull/207

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

0.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: https://github.com/neithere/argh/compare/v0.30.0...v0.30.1

Full changelog: https://argh.readthedocs.io/en/latest/changes.html#version-0-30-1

0.30.0

What's Changed
* Remove previously deprecated code (closes 184) by neithere in https://github.com/neithere/argh/pull/188
* Type annotations for existing code (closes 185) by neithere in https://github.com/neithere/argh/pull/189
* Deprecate `help` command alias and `expects_obj` decorator by neithere in https://github.com/neithere/argh/pull/192
* Document usage with class methods (closes 138) by neithere in https://github.com/neithere/argh/pull/194
* Remove pre_call, expose finer control over dispatching (re 63) by neithere in https://github.com/neithere/argh/pull/193
* Add support for Python 3.12 (closes 196) by neithere in https://github.com/neithere/argh/pull/195
* Refactor assembling module (closes 197) by neithere in https://github.com/neithere/argh/pull/198
* Keyword-only arguments as options (closes 191) by neithere in https://github.com/neithere/argh/pull/199

**Full Changelog**: https://github.com/neithere/argh/compare/v0.29.4...v0.30.0

0.30.0alpha

What's Changed
* Remove previously deprecated code (closes 184) by neithere in https://github.com/neithere/argh/pull/188
* Type annotations for existing code (closes 185) by neithere in https://github.com/neithere/argh/pull/189
* Deprecate `help` command alias and `expects_obj` decorator by neithere in https://github.com/neithere/argh/pull/192
* Document usage with class methods (closes 138) by neithere in https://github.com/neithere/argh/pull/194
* Remove pre_call, expose finer control over dispatching (re 63) by neithere in https://github.com/neithere/argh/pull/193
* Add support for Python 3.12 (closes 196) by neithere in https://github.com/neithere/argh/pull/195
* Refactor assembling module (closes 197) by neithere in https://github.com/neithere/argh/pull/198
* Keyword-only arguments as options (closes 191) by neithere in https://github.com/neithere/argh/pull/199

**Full Changelog**: https://github.com/neithere/argh/compare/v0.29.4...v0.30.0-alpha

0.29.4

Bugs fixed:

- Test coverage reported as <100% when argcomplete is installed (187)

0.29.3

This is a technical release for packaging purposes.

0.29.2

This is a technical release for packaging purposes.

0.29.1

This is a technical release for packaging purposes.

0.29.0

What's Changed

Backwards incompatible changes:

* Wrapped exceptions now cause ``dispatching.dispatch()`` to raise ``SystemExit(1)``
instead of returning without error. For most users, this means failed commands
will now exit with a failure status instead of a success (by ekimekim in 161).

Deprecated:

* Renamed arguments in `add_commands()` (165 / 178):

- `namespace` → `group_name`
- `namespace_kwargs` → `group_kwargs`

The old names are deprecated and will be removed in v.0.30.

Enhancements:

* Can control exit status (see Backwards Incompatible Changes above) when raising
``CommandError`` using the ``code`` keyword arg.

Bugs fixed:

*  Positional arguments should not lead to removal of short form of keyword argument by neithere in 181

Other changes:

* Avoid depending on iocapture by using pytest's built-in feature by mr-c in 177
* chore: publishing to prod PyPI by neithere in 173
* test: add coverage for action="count" (127) by neithere in 183

New Contributors
* ekimekim made their first contribution in https://github.com/neithere/argh/pull/161
* mr-c made their first contribution in https://github.com/neithere/argh/pull/177

**Full Changelog**: https://github.com/neithere/argh/compare/v0.28.1...v0.29.0

0.28.1

What's Changed
* Add Github workflow to publish the release to PyPI by neithere in https://github.com/neithere/argh/pull/167
* fix: argcomplete-related test by neithere in 172 (reported in 169 by kloczek)
* fix: assumed prog name in tests by neithere in 171 (reported in 170 by mgorny)

**Full Changelog**: https://github.com/neithere/argh/compare/v0.28.0...v0.28.1

Thanks to everyone who reported

0.28.0

A major modernisation and cleanup.

Backward incompatible changes:

- Dropped support for Python 2.7 and 3.7.

Deprecated features, to be removed in v.0.30:

- `argh.assembling.SUPPORTS_ALIASES`.

- Always `True` for recent versions of Python.

- `argh.io.safe_input()` AKA `argh.interaction.safe_input()`.

- Not relevant anymore.  Please use the built-in `input()` instead.

- argument `pre_call` in `dispatch()`.

Even though this hack seems to have been used in some projects, it was never part of the official API and never recommended.

Describing your use case in the discussion about shared arguments (63) can help improve the library to accomodate it in a proper way.

- Argument help as annotations.

- Annotations will only be used for types after v.0.30.
- Please replace any instance of:
 
 def func(foo: "Foobar"):
 
 with the following::
 
 arg('-f', '--foo', help="Foobar")
 def func(foo):
 
 It will be decided later how to keep this functionality "DRY" (don't repeat yourself) without conflicts with modern conventions and tools.

- Added deprecation warnings for some arguments deprecated back in v.0.26.

**Full Changelog**: https://github.com/neithere/argh/compare/v0.27.2...v0.28.0

0.27.2

Minor packaging fix:

* chore: include file required by tox.ini in the sdist (155)

0.27.1

Minor building and packaging fixes:

* docs: add Read the Docs config (160)
* chore: include tox.ini in the sdist (155)

Contributors:

mtelka (155)

0.27.0

This is the last version to support Python 2.7.

Backward incompatible changes:

- Dropped support for Python 2.6.

Enhancements:

- Added support for Python 3.7 through 3.11.
- Support introspection of function signature behind the `wraps` decorator (issue 111).

Fixed bugs:

- When command function signature contained ``**kwargs`` *and* positionals without defaults and with underscores in their names, a weird behaviour could be observed (issue 104).
- Fixed introspection through decorators (issue 111).
- Switched to Python's built-in `unittest.mock` (PR 154).
- Fixed bug with `skip_unknown_args=True` (PR 134).
- Fixed tests for Python 3.9.7+ (issue 148).

Other changes:

- Included the license files in manifest (PR 112).
- Extended the list of similar projects (PR 87).
- Fixed typos and links in documentation (PR 110, 116, 156).
- Switched CI to Github Actions (PR 153).

Contributors:

dwf (105), jwilk (110), jakirkham (112), brilee, sanga (116), Gidgidonihah (134), mrdavidlaing (153), jelly (154), mtelka (154), hugovk (reviewing PRs).
Links

@pyup-bot pyup-bot mentioned this pull request Jan 24, 2024
@pyup-bot
Copy link
Collaborator Author

Closing this in favor of #1145

@pyup-bot pyup-bot closed this Jul 13, 2024
@StuartJSquires StuartJSquires deleted the pyup-update-argh-0.26.2-to-0.31.2 branch July 13, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant