Skip to content

Commit 039a239

Browse files
committed
small ruff fixes
1 parent edb9803 commit 039a239

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

progressbar/bar.py

Lines changed: 1 addition & 1 deletion
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.Union[NumberT, typing.Type[base.UnknownLength], None]
37+
ValueT = typing.Union[NumberT, type[base.UnknownLength], None]
3838

3939
T = types.TypeVar('T')
4040

progressbar/multi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class SortKey(str, enum.Enum):
4343
PERCENTAGE = 'percentage'
4444

4545

46-
class MultiBar(typing.Dict[str, bar.ProgressBar]):
46+
class MultiBar(dict[str, bar.ProgressBar]):
4747
fd: typing.TextIO
4848
_buffer: io.StringIO
4949

progressbar/terminal/stream.py

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

33
import sys
44
import typing
5+
from collections.abc import Iterable, Iterator
56
from types import TracebackType
6-
from typing import Iterable, Iterator
77

88
from progressbar import base
99

progressbar/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import os
99
import re
1010
import sys
11+
from collections.abc import Iterable, Iterator
1112
from types import TracebackType
12-
from typing import Iterable, Iterator
1313

1414
from python_utils import types
1515
from python_utils.converters import scale_1024

ruff.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# We keep the ruff configuration separate so it can easily be shared across
22
# all projects
33

4-
target-version = 'py38'
4+
target-version = 'py39'
55

66
#src = ['progressbar']
77
exclude = [
88
'.venv',
99
'.tox',
10+
# Ignore local test files/directories/old-stuff
1011
'test.py',
12+
'*_old.py',
1113
]
1214

13-
lint.ignore = [
15+
line-length = 79
16+
17+
[lint]
18+
ignore = [
1419
'A001', # Variable {name} is shadowing a Python builtin
1520
'A002', # Argument {name} is shadowing a Python builtin
1621
'A003', # Class attribute {name} is shadowing a Python builtin
@@ -28,12 +33,14 @@ lint.ignore = [
2833
'RET506', # Unnecessary `else` after `raise` statement
2934
'Q001', # Remove bad quotes
3035
'Q002', # Remove bad quotes
36+
'FA100', # Missing `from __future__ import annotations`, but uses `typing.Optional`
3137
'COM812', # Missing trailing comma in a list
3238
'ISC001', # String concatenation with implicit str conversion
3339
'SIM108', # Ternary operators are not always more readable
40+
'RUF100', # Unused noqa directives. Due to multiple Python versions, we need to keep them
3441
]
35-
line-length = 79
36-
lint.select = [
42+
43+
select = [
3744
'A', # flake8-builtins
3845
'ASYNC', # flake8 async checker
3946
'B', # flake8-bugbear

0 commit comments

Comments
 (0)