Skip to content

Commit 537753a

Browse files
authored
Merge pull request #222 from DanCardin/dc/pyright
fix: Apply pyright strict typing.
2 parents 9fbb1c5 + fc57e93 commit 537753a

134 files changed

Lines changed: 1282 additions & 1038 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/source/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
```{eval-rst}
44
.. autoapimodule:: cappa
5-
:members: parse, invoke, invoke_async, collect, command, Command, Subcommand, Dep, Arg, ArgAction, Exit, Env, Completion, Output, FileMode, unpack_arguments, Group, Prompt, Confirm, ValueFrom, Default, State, Self
5+
:members: parse, invoke, invoke_async, collect, command, Command, Subcommand, Dep, Arg, ArgAction, Exit, Env, Completion, Output, FileMode, unpack_arguments, Group, Prompt, Confirm, ValueFrom, Default, State, Self, default_parse
66
```
77

88
```{eval-rst}

docs/source/arg.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ Note cappa itself contains a number of component `parse_*` functions inside the
457457
module, which can be used in combination with your own custom `parse` functions.
458458
```
459459
460+
### `default_parse`
461+
462+
A function [cappa.default_parse](cappa.default_parse) is exposed
463+
460464
(parsing-json)=
461465
### Parsing JSON
462466

examples/defer_import_slow_startup/defer_import/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ class MeanCommand:
1717

1818

1919
def main():
20-
cappa.invoke(DeferImport)
20+
return cappa.invoke(DeferImport)

examples/defer_import_slow_startup/uv.lock

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies = [
1616
"rich >= 10.2.0",
1717
"typing-extensions >= 4.8.0",
1818
"typing-extensions >= 4.12.0; python_version >= '3.13'",
19-
"type-lens >= 0.2.3",
19+
"type-lens >= 0.2.4",
2020
]
2121

2222
[project.optional-dependencies]
@@ -80,6 +80,11 @@ warn_unused_ignores = true
8080
incremental = true
8181
check_untyped_defs = true
8282

83+
[tool.pyright]
84+
typeCheckingMode = "strict"
85+
typeCheckingModeOverrides = { "type_lens/**" = "basic" }
86+
87+
8388
[tool.typos.default]
8489
extend-ignore-re = [".*#.*typos: ignore[^\\n]*\\n"]
8590

src/cappa/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from cappa.help import HelpFormattable, HelpFormatter
77
from cappa.invoke import Dep, Self
88
from cappa.output import Exit, HelpExit, Output
9-
from cappa.parse import unpack_arguments
9+
from cappa.parse import default_parse, unpack_arguments
1010
from cappa.state import State
1111
from cappa.subcommand import Subcommand, Subcommands
1212
from cappa.type_view import Empty, EmptyType
@@ -46,6 +46,7 @@
4646
"backend",
4747
"collect",
4848
"command",
49+
"default_parse",
4950
"invoke",
5051
"invoke_async",
5152
"parse",

0 commit comments

Comments
 (0)