Skip to content

Commit f5d10d4

Browse files
Upgrade Mypy to version 0.812 (#1705)
1 parent d21793d commit f5d10d4

File tree

12 files changed

+21
-7
lines changed

12 files changed

+21
-7
lines changed

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ flake8~=3.7
33
isort~=5.6
44
black>=19.3b0,==19.*
55
httpretty~=1.0
6-
mypy==0.790
6+
mypy==0.812
77
sphinx~=2.1
88
sphinx-rtd-theme~=0.4
99
sphinx-autodoc-typehints~=1.10.2

opentelemetry-api/src/opentelemetry/__init__.pyi

Whitespace-only changes.

opentelemetry-api/src/opentelemetry/context/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def _load_runtime_context(func: _F) -> _F:
3737
A wrapper of the decorated method.
3838
"""
3939

40-
@wraps(func) # type: ignore
41-
def wrapper(
40+
@wraps(func) # type: ignore[misc]
41+
def wrapper( # type: ignore[misc]
4242
*args: typing.Tuple[typing.Any, typing.Any],
4343
**kwargs: typing.Dict[typing.Any, typing.Any]
4444
) -> typing.Optional[typing.Any]:
@@ -63,9 +63,9 @@ def wrapper(
6363
logger.error(
6464
"Failed to load context: %s", configured_context
6565
)
66-
return func(*args, **kwargs) # type: ignore
66+
return func(*args, **kwargs) # type: ignore[misc]
6767

68-
return wrapper # type:ignore
68+
return typing.cast(_F, wrapper) # type: ignore[misc]
6969

7070

7171
def get_value(key: str, context: typing.Optional[Context] = None) -> "object":

opentelemetry-api/src/opentelemetry/util/_time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
)
2626
from time import time
2727

28-
def _time_ns():
28+
def _time_ns() -> int:
2929
return int(time() * 1e9)
3030

3131

opentelemetry-api/tests/baggage/test_baggage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# type: ignore
16+
1517
import unittest
1618

1719
from opentelemetry import baggage, context

opentelemetry-api/tests/baggage/test_baggage_propagation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
#
15+
# type: ignore
16+
1517
import unittest
1618
from unittest.mock import Mock, patch
1719

opentelemetry-api/tests/propagators/test_composite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# type: ignore
16+
1517
import unittest
1618
from unittest.mock import Mock
1719

opentelemetry-api/tests/propagators/test_global_httptextformat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# type: ignore
16+
1517
import unittest
1618

1719
from opentelemetry import baggage, trace

opentelemetry-api/tests/propagators/test_propagators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# type: ignore
16+
1517
from importlib import reload
1618
from os import environ
1719
from unittest import TestCase

opentelemetry-api/tests/trace/propagation/test_textmap.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# type: ignore
16+
1517
import unittest
1618

1719
from opentelemetry.propagators.textmap import DictGetter

0 commit comments

Comments
 (0)