Skip to content

Commit ef4e39b

Browse files
Ryan Whitmorebrandonwillard
authored andcommitted
Bump dependency versions in the pre-commit hooks and address warnings
and errors in the code base that were introduced from the version updates.
1 parent 77d4a5c commit ef4e39b

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,37 @@ exclude: |
55
)$
66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.4.0
8+
rev: v4.5.0
99
hooks:
1010
- id: debug-statements
1111
- id: check-merge-conflict
1212
- repo: https://github.com/psf/black
13-
rev: 23.3.0
13+
rev: 23.12.1
1414
hooks:
1515
- id: black
1616
language_version: python3
1717
- repo: https://github.com/pycqa/flake8
18-
rev: 6.0.0
18+
rev: 7.0.0
1919
hooks:
2020
- id: flake8
2121
- repo: https://github.com/pycqa/isort
22-
rev: 5.12.0
22+
rev: 5.13.2
2323
hooks:
2424
- id: isort
25-
- repo: https://github.com/humitos/mirrors-autoflake.git
26-
rev: v1.1
25+
- repo: https://github.com/PyCQA/autoflake
26+
rev: v2.2.1
2727
hooks:
2828
- id: autoflake
2929
exclude: |
3030
(?x)^(
3131
.*/?__init__\.py|
3232
)$
3333
args:
34-
[
35-
"--in-place",
36-
"--remove-all-unused-imports",
37-
"--remove-unused-variable",
38-
]
34+
- --in-place
35+
- --remove-all-unused-imports
36+
- --remove-unused-variables
3937
- repo: https://github.com/pre-commit/mirrors-mypy
40-
rev: v1.4.0
38+
rev: v1.8.0
4139
hooks:
4240
- id: mypy
4341
additional_dependencies:

etuples/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _repr_pretty_(self, p, cycle):
102102

103103
def __eq__(self, other):
104104
return (
105-
type(self) == type(other)
105+
type(self) is type(other)
106106
and self.arg == other.arg
107107
and self.value == other.value
108108
)
@@ -132,7 +132,7 @@ def __new__(cls, seq=None, **kwargs):
132132
# It does, however, remove it for the check below.
133133
kwargs.pop("evaled_obj", None)
134134

135-
if seq is not None and not kwargs and type(seq) == cls:
135+
if seq is not None and not kwargs and type(seq) is cls:
136136
return seq
137137

138138
res = super().__new__(cls)

tests/test_core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_op(*args):
9898

9999
e1_obj = e1.evaled_obj
100100
assert len(e1_obj) == 3
101-
assert all(type(o) == object for o in e1_obj)
101+
assert all(type(o) is object for o in e1_obj)
102102

103103
# Make sure we don't re-create the cached `evaled_obj`
104104
e1_obj_2 = e1.evaled_obj
@@ -109,17 +109,17 @@ def test_op(*args):
109109

110110
# Make sure we didn't convert this single tuple value to
111111
# an `etuple`
112-
assert type(e2[1]) == tuple
112+
assert type(e2[1]) is tuple
113113

114114
# Slices should be `etuple`s, though.
115115
assert isinstance(e2[:1], ExpressionTuple)
116116
assert e2[1] == e2[1:2][0]
117117

118118
e2_obj = e2.evaled_obj
119119

120-
assert type(e2_obj) == tuple
120+
assert type(e2_obj) is tuple
121121
assert len(e2_obj) == 4
122-
assert all(type(o) == object for o in e2_obj)
122+
assert all(type(o) is object for o in e2_obj)
123123
# Make sure that it used `e1`'s original `evaled_obj`
124124
assert e2_obj[1:] == e1_obj
125125

tests/test_dispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(self, rator, rands):
1515

1616
def __eq__(self, other):
1717
return (
18-
type(self) == type(other)
18+
type(self) is type(other)
1919
and self.rator == other.rator
2020
and self.rands == other.rands
2121
)

0 commit comments

Comments
 (0)