Skip to content

Commit

Permalink
Merge pull request #104 from DanCardin/dc/commandrunner-signature
Browse files Browse the repository at this point in the history
fix: Correct the testing.CommandRunner deps signature.
  • Loading branch information
DanCardin authored Mar 1, 2024
2 parents b53fd57 + ac49537 commit a431337
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## 0.16

### 0.16.6

- fix: Correct the testing.CommandRunner deps signature.

### 0.16.5

- fix: Error short help should be contextual to the failing command.

### 0.16.4

- fix: Ensure optional bool retains bool action inference.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cappa"
version = "0.16.5"
version = "0.16.6"
description = "Declarative CLI argument parser."

repository = "https://github.com/dancardin/cappa"
Expand Down
10 changes: 7 additions & 3 deletions src/cappa/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
create_help_arg,
create_version_arg,
)
from cappa.invoke import resolve_callable
from cappa.invoke import Dep, resolve_callable
from cappa.output import Output

if typing.TYPE_CHECKING:
Expand Down Expand Up @@ -79,7 +79,9 @@ def parse(
def invoke(
obj: type | Command,
*,
deps: typing.Sequence[typing.Callable] | None = None,
deps: typing.Sequence[typing.Callable]
| typing.Mapping[typing.Callable, Dep | typing.Any]
| None = None,
argv: list[str] | None = None,
backend: typing.Callable | None = None,
color: bool = True,
Expand Down Expand Up @@ -143,7 +145,9 @@ def invoke(
async def invoke_async(
obj: type | Command,
*,
deps: typing.Sequence[typing.Callable] | None = None,
deps: typing.Sequence[typing.Callable]
| typing.Mapping[typing.Callable, Dep | typing.Any]
| None = None,
argv: list[str] | None = None,
backend: typing.Callable | None = None,
color: bool = True,
Expand Down
8 changes: 6 additions & 2 deletions src/cappa/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class RunnerArgs(typing.TypedDict, total=False):
"""Available kwargs for `parse` and `invoke` function, to match `CommandRunner` fields."""

obj: type
deps: typing.Sequence[typing.Callable]
deps: typing.Sequence[typing.Callable] | typing.Mapping[
typing.Callable, cappa.Dep | typing.Any
] | None
backend: typing.Callable | None
output: cappa.Output | None
color: bool
Expand Down Expand Up @@ -70,7 +72,9 @@ class CommandRunner:
"""

obj: type | None = None
deps: typing.Sequence[typing.Callable] | None = None
deps: typing.Sequence[typing.Callable] | typing.Mapping[
typing.Callable, cappa.Dep | typing.Any
] | None = None
backend: typing.Callable | None = None
output: cappa.Output | None = None
color: bool = True
Expand Down

0 comments on commit a431337

Please sign in to comment.