Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHON-3679 Support mypy 1.2 #1194

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
cache-dependency-path: 'setup.py'
- name: Install dependencies
run: |
python -m pip install -U pip mypy==0.990
python -m pip install -U pip mypy==1.2
pip install -e ".[zstd, encryption, ocsp]"
- name: Run mypy
run: |
Expand Down
2 changes: 1 addition & 1 deletion bson/decimal128.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _decimal_to_128(value: _VALUE_OPTIONS) -> Tuple[int, int]:
if significand & (1 << i):
high |= 1 << (i - 64)

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

if high >> 49 == 1:
high = high & 0x7FFFFFFFFFFF
Expand Down
4 changes: 2 additions & 2 deletions bson/son.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(
self.update(kwargs)

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

Expand Down Expand Up @@ -115,7 +115,7 @@ def clear(self) -> None:
self.__keys = []
super(SON, self).clear()

def setdefault(self, key: _Key, default: _Value) -> _Value: # type: ignore[override]
def setdefault(self, key: _Key, default: _Value) -> _Value:
try:
return self[key]
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion test/test_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,7 @@ def test_05_tlsDisableOCSPEndpointCheck_is_permitted(self):
self.addCleanup(encryption.close)
ctx = encryption._io_callbacks.opts._kms_ssl_contexts["aws"]
if not hasattr(ctx, "check_ocsp_endpoint"):
raise self.skipTest("OCSP not enabled") # type:ignore
raise self.skipTest("OCSP not enabled")
self.assertFalse(ctx.check_ocsp_endpoint)


Expand Down