Skip to content

Commit 2bafb5b

Browse files
author
Brian Kohan
committed
add pyright back to linting CI and fix typing errors, fix #51
1 parent 3765840 commit 2bafb5b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@ jobs:
5252
black django_typer --check
5353
pylint django_typer
5454
mypy django_typer
55+
pyright
5556
poetry check
5657
pip check
5758
python -m readme_renderer ./README.md -o /tmp/README.html
5859
cd ./doc
5960
doc8 --ignore-path build --max-line-length 100
6061
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
61-
62-
# - name: Run pyright
63-
# uses: jakebailey/pyright-action@v2

django_typer/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,8 +1210,8 @@ class TyperCommandMeta(type):
12101210
"""
12111211

12121212
style: ColorStyle
1213-
stdout: t.IO[str]
1214-
stderr: t.IO[str]
1213+
stdout: BaseOutputWrapper
1214+
stderr: BaseOutputWrapper
12151215
requires_system_checks: t.Union[t.Sequence[str], str]
12161216
suppressed_base_arguments: t.Optional[t.Iterable[str]]
12171217
typer_app: Typer

django_typer/apps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
patch.apply()
2222

2323
rich: t.Union[ModuleType, None] = None
24+
traceback: t.Union[ModuleType, None] = None
2425

2526
try:
2627
import sys
@@ -34,6 +35,7 @@
3435
# install rich tracebacks if we've been configured to do so (default)
3536
no_color = "NO_COLOR" in os.environ
3637
force_color = "FORCE_COLOR" in os.environ
38+
traceback = t.cast(ModuleType, traceback)
3739
traceback.install(
3840
console=tb_config.pop(
3941
"console",

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ scipy = [
8888
]
8989
django-stubs = "^4.2.7"
9090
pexpect = "^4.9.0"
91+
pyright = "^1.1.357"
9192

9293
[tool.poetry.extras]
9394
rich = ["rich"]

0 commit comments

Comments
 (0)