Skip to content

Commit

Permalink
Bump ruff and black to their latest versions (python#16221)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Oct 4, 2023
1 parent b1ba661 commit a1df335
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.7.0 # must match test-requirements.txt
rev: 23.9.1 # must match test-requirements.txt
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.281 # must match test-requirements.txt
rev: v0.0.292 # must match test-requirements.txt
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3024,7 +3024,7 @@ def dump_graph(graph: Graph, stdout: TextIO | None = None) -> None:
if state.path:
try:
size = os.path.getsize(state.path)
except os.error:
except OSError:
pass
node.sizes[mod] = size
for dep in state.dependencies:
Expand Down
2 changes: 1 addition & 1 deletion mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
def stat_proxy(path: str) -> os.stat_result:
try:
st = orig_stat(path)
except os.error as err:
except OSError as err:
print(f"stat({path!r}) -> {err}")
raise
else:
Expand Down
2 changes: 1 addition & 1 deletion mypy/metastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def write(self, name: str, data: str, mtime: float | None = None) -> bool:
if mtime is not None:
os.utime(path, times=(mtime, mtime))

except os.error:
except OSError:
return False
return True

Expand Down
2 changes: 1 addition & 1 deletion mypy/plugins/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def find_shallow_matching_overload_item(overload: Overloaded, call: CallExpr) ->
):
ok = False
break
elif isinstance(arg_type, LiteralType) and type(arg_type.value) is bool:
elif isinstance(arg_type, LiteralType) and isinstance(arg_type.value, bool):
if not any(parse_bool(arg) == arg_type.value for arg in args):
ok = False
break
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ unfixable = [
"F601", # automatic fix might obscure issue
"F602", # automatic fix might obscure issue
"B018", # automatic fix might obscure issue
"UP036", # sometimes it's better to just noqa this
]

extend-exclude = [
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sys
from typing import TYPE_CHECKING, Any

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

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

0 comments on commit a1df335

Please sign in to comment.