Skip to content

Commit a1df335

Browse files
authored
Bump ruff and black to their latest versions (#16221)
Closes #16218
1 parent b1ba661 commit a1df335

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ repos:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 23.7.0 # must match test-requirements.txt
9+
rev: 23.9.1 # must match test-requirements.txt
1010
hooks:
1111
- id: black
1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.0.281 # must match test-requirements.txt
13+
rev: v0.0.292 # must match test-requirements.txt
1414
hooks:
1515
- id: ruff
1616
args: [--exit-non-zero-on-fix]

mypy/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3024,7 +3024,7 @@ def dump_graph(graph: Graph, stdout: TextIO | None = None) -> None:
30243024
if state.path:
30253025
try:
30263026
size = os.path.getsize(state.path)
3027-
except os.error:
3027+
except OSError:
30283028
pass
30293029
node.sizes[mod] = size
30303030
for dep in state.dependencies:

mypy/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
def stat_proxy(path: str) -> os.stat_result:
3434
try:
3535
st = orig_stat(path)
36-
except os.error as err:
36+
except OSError as err:
3737
print(f"stat({path!r}) -> {err}")
3838
raise
3939
else:

mypy/metastore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def write(self, name: str, data: str, mtime: float | None = None) -> bool:
112112
if mtime is not None:
113113
os.utime(path, times=(mtime, mtime))
114114

115-
except os.error:
115+
except OSError:
116116
return False
117117
return True
118118

mypy/plugins/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def find_shallow_matching_overload_item(overload: Overloaded, call: CallExpr) ->
154154
):
155155
ok = False
156156
break
157-
elif isinstance(arg_type, LiteralType) and type(arg_type.value) is bool:
157+
elif isinstance(arg_type, LiteralType) and isinstance(arg_type.value, bool):
158158
if not any(parse_bool(arg) == arg_type.value for arg in args):
159159
ok = False
160160
break

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ unfixable = [
5858
"F601", # automatic fix might obscure issue
5959
"F602", # automatic fix might obscure issue
6060
"B018", # automatic fix might obscure issue
61+
"UP036", # sometimes it's better to just noqa this
6162
]
6263

6364
extend-exclude = [

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sys
99
from typing import TYPE_CHECKING, Any
1010

11-
if sys.version_info < (3, 8, 0):
11+
if sys.version_info < (3, 8, 0): # noqa: UP036
1212
sys.stderr.write("ERROR: You need Python 3.8 or later to use mypy.\n")
1313
exit(1)
1414

test-requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-r mypy-requirements.txt
22
-r build-requirements.txt
33
attrs>=18.0
4-
black==23.7.0 # must match version in .pre-commit-config.yaml
4+
black==23.9.1 # must match version in .pre-commit-config.yaml
55
filelock>=3.3.0
66
# lxml 4.9.3 switched to manylinux_2_28, the wheel builder still uses manylinux2014
77
lxml>=4.9.1,<4.9.3; (python_version<'3.11' or sys_platform!='win32') and python_version<'3.12'
@@ -11,6 +11,6 @@ psutil>=4.0
1111
pytest>=7.4.0
1212
pytest-xdist>=1.34.0
1313
pytest-cov>=2.10.0
14-
ruff==0.0.280 # must match version in .pre-commit-config.yaml
14+
ruff==0.0.292 # must match version in .pre-commit-config.yaml
1515
setuptools>=65.5.1
1616
tomli>=1.1.0 # needed even on py311+ so the self check passes with --python-version 3.7

0 commit comments

Comments
 (0)