Skip to content

Commit

Permalink
chore: deprecate dispatch(..., namespace=N)
Browse files Browse the repository at this point in the history
The argument `namespace` is deprecated for the following public
functions:

- `dispatch()`
- `parse_and_resolve()`
  • Loading branch information
neithere committed Dec 28, 2023
1 parent e4d5ca8 commit 934998e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGES.rst
Expand Up @@ -9,6 +9,14 @@ Enhancements:

- Added `always_flush` argument to `dispatch()` (issue #145)

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.

Version 0.30.5 (2023-12-25)
---------------------------

Expand Down
10 changes: 10 additions & 0 deletions src/argh/dispatching.py
Expand Up @@ -143,6 +143,10 @@ def dispatch(
that support for combined default and nested functions may be broken
if a different type of object is forced.
.. deprecated:: 0.31
This argument will be removed soon after v0.31.
:param always_flush:
If the output stream is not a terminal (i.e. redirected to a file or
Expand Down Expand Up @@ -211,6 +215,12 @@ def parse_and_resolve(
.. versionadded:: 0.30
Parses CLI arguments and resolves the endpoint function.
:param namespace:
.. deprecated:: 0.31
This argument will be removed soon after v0.31.
"""
if completion:
autocomplete(parser)
Expand Down

0 comments on commit 934998e

Please sign in to comment.