Skip to content

Commit bc9029a

Browse files
authored
PYTHON-3679 Support mypy 1.2 (#1194)
1 parent e75cfec commit bc9029a

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

.github/workflows/test-python.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
cache-dependency-path: 'setup.py'
5959
- name: Install dependencies
6060
run: |
61-
python -m pip install -U pip mypy==0.990
61+
python -m pip install -U pip mypy==1.2
6262
pip install -e ".[zstd, encryption, ocsp]"
6363
- name: Run mypy
6464
run: |

bson/decimal128.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def _decimal_to_128(value: _VALUE_OPTIONS) -> Tuple[int, int]:
100100
if significand & (1 << i):
101101
high |= 1 << (i - 64)
102102

103-
biased_exponent = exponent + _EXPONENT_BIAS
103+
biased_exponent = exponent + _EXPONENT_BIAS # type: ignore[operator]
104104

105105
if high >> 49 == 1:
106106
high = high & 0x7FFFFFFFFFFF

bson/son.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
self.update(kwargs)
6767

6868
def __new__(cls: Type["SON[_Key, _Value]"], *args: Any, **kwargs: Any) -> "SON[_Key, _Value]":
69-
instance = super(SON, cls).__new__(cls, *args, **kwargs)
69+
instance = super(SON, cls).__new__(cls, *args, **kwargs) # type: ignore[type-var]
7070
instance.__keys = []
7171
return instance
7272

@@ -115,7 +115,7 @@ def clear(self) -> None:
115115
self.__keys = []
116116
super(SON, self).clear()
117117

118-
def setdefault(self, key: _Key, default: _Value) -> _Value: # type: ignore[override]
118+
def setdefault(self, key: _Key, default: _Value) -> _Value:
119119
try:
120120
return self[key]
121121
except KeyError:

test/test_encryption.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,7 @@ def test_05_tlsDisableOCSPEndpointCheck_is_permitted(self):
21622162
self.addCleanup(encryption.close)
21632163
ctx = encryption._io_callbacks.opts._kms_ssl_contexts["aws"]
21642164
if not hasattr(ctx, "check_ocsp_endpoint"):
2165-
raise self.skipTest("OCSP not enabled") # type:ignore
2165+
raise self.skipTest("OCSP not enabled")
21662166
self.assertFalse(ctx.check_ocsp_endpoint)
21672167

21682168

0 commit comments

Comments
 (0)