Skip to content

Commit 23170ee

Browse files
committed
pyright fixes for older python versions
1 parent 1c4b639 commit 23170ee

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

progressbar/bar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# float also accepts integers and longs but we don't want an explicit union
3535
# due to type checking complexity
3636
NumberT = float
37-
ValueT: typing.TypeAlias = typing.Union[
37+
ValueT = typing.Union[
3838
NumberT, typing.Type[base.UnknownLength], None
3939
]
4040

@@ -977,7 +977,7 @@ def start(
977977
init: bool = True,
978978
*args: typing.Any,
979979
**kwargs: typing.Any,
980-
) -> typing.Self:
980+
) -> ProgressBar:
981981
"""Starts measuring time, and prints the bar at 0%.
982982
983983
It returns self so you can use it like this:

tox.ini

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ envlist =
66
py311
77
docs
88
black
9-
pyright
109
ruff
1110
; mypy
1211
; codespell
1312
skip_missing_interpreters = True
1413

1514
[testenv]
16-
deps = -r{toxinidir}/tests/requirements.txt
17-
commands = py.test --basetemp="{envtmpdir}" --confcutdir=.. {posargs}
18-
;changedir = tests
15+
deps =
16+
-r{toxinidir}/tests/requirements.txt
17+
pyright
18+
commands =
19+
pyright
20+
py.test --basetemp="{envtmpdir}" --confcutdir=.. {posargs}
1921
skip_install = true
2022

2123
[testenv:mypy]
@@ -24,14 +26,6 @@ basepython = python3
2426
deps = mypy
2527
commands = mypy {toxinidir}/progressbar
2628

27-
[testenv:pyright]
28-
changedir =
29-
basepython = python3
30-
deps =
31-
pyright
32-
python_utils
33-
commands = pyright {toxinidir}/progressbar
34-
3529
[testenv:black]
3630
basepython = python3
3731
deps = black

0 commit comments

Comments
 (0)