Skip to content

Commit

Permalink
Bump mypy to 1.9.0 (#3795)
Browse files Browse the repository at this point in the history
  • Loading branch information
xrmx committed Apr 2, 2024
1 parent 05497a5 commit cb800f0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 22 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3633](https://github.com/open-telemetry/opentelemetry-python/pull/3633))
- Fix python 3.12 deprecation warning
([#3751](https://github.com/open-telemetry/opentelemetry-python/pull/3751))
- bump mypy to 0.982
([#3776](https://github.com/open-telemetry/opentelemetry-python/pull/3776))
- Add support for OTEL_SDK_DISABLED environment variable
([#3648](https://github.com/open-telemetry/opentelemetry-python/pull/3648))
- Fix ValueError message for PeriodicExportingMetricsReader
Expand All @@ -27,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3778](https://github.com/open-telemetry/opentelemetry-python/pull/3778))
- Fix license field in pyproject.toml files
([#3803](https://github.com/open-telemetry/opentelemetry-python/pull/3803))
- Bump mypy to 1.9.0
([#3795](https://github.com/open-telemetry/opentelemetry-python/pull/3795))

## Version 1.23.0/0.44b0 (2024-02-23)

Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ flake8==6.1.0
isort==5.12.0
black==22.3.0
httpretty==1.1.4
mypy==0.982
mypy==1.9.0
sphinx==7.1.2
sphinx-rtd-theme==2.0.0rc4
sphinx-autodoc-typehints==1.25.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ def get_logger(
schema_url: Optional[str] = None,
) -> Logger:
"""Returns a NoOpLogger."""
super().get_logger(name, version=version, schema_url=schema_url)
return NoOpLogger(name, version=version, schema_url=schema_url)


Expand Down
16 changes: 0 additions & 16 deletions opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def get_meter(
schema_url: Optional[str] = None,
) -> "Meter":
"""Returns a NoOpMeter."""
super().get_meter(name, version=version, schema_url=schema_url)
return NoOpMeter(name, version=version, schema_url=schema_url)


Expand Down Expand Up @@ -599,7 +598,6 @@ def create_counter(
description: str = "",
) -> Counter:
"""Returns a no-op Counter."""
super().create_counter(name, unit=unit, description=description)
if self._is_instrument_registered(
name, NoOpCounter, unit, description
)[0]:
Expand All @@ -620,7 +618,6 @@ def create_gauge(
description: str = "",
) -> Gauge:
"""Returns a no-op Gauge."""
super().create_gauge(name, unit=unit, description=description)
if self._is_instrument_registered(name, NoOpGauge, unit, description)[
0
]:
Expand All @@ -641,9 +638,6 @@ def create_up_down_counter(
description: str = "",
) -> UpDownCounter:
"""Returns a no-op UpDownCounter."""
super().create_up_down_counter(
name, unit=unit, description=description
)
if self._is_instrument_registered(
name, NoOpUpDownCounter, unit, description
)[0]:
Expand All @@ -665,9 +659,6 @@ def create_observable_counter(
description: str = "",
) -> ObservableCounter:
"""Returns a no-op ObservableCounter."""
super().create_observable_counter(
name, callbacks, unit=unit, description=description
)
if self._is_instrument_registered(
name, NoOpObservableCounter, unit, description
)[0]:
Expand All @@ -693,7 +684,6 @@ def create_histogram(
description: str = "",
) -> Histogram:
"""Returns a no-op Histogram."""
super().create_histogram(name, unit=unit, description=description)
if self._is_instrument_registered(
name, NoOpHistogram, unit, description
)[0]:
Expand All @@ -715,9 +705,6 @@ def create_observable_gauge(
description: str = "",
) -> ObservableGauge:
"""Returns a no-op ObservableGauge."""
super().create_observable_gauge(
name, callbacks, unit=unit, description=description
)
if self._is_instrument_registered(
name, NoOpObservableGauge, unit, description
)[0]:
Expand All @@ -744,9 +731,6 @@ def create_observable_up_down_counter(
description: str = "",
) -> ObservableUpDownCounter:
"""Returns a no-op ObservableUpDownCounter."""
super().create_observable_up_down_counter(
name, callbacks, unit=unit, description=description
)
if self._is_instrument_registered(
name, NoOpObservableUpDownCounter, unit, description
)[0]:
Expand Down
3 changes: 2 additions & 1 deletion opentelemetry-api/src/opentelemetry/util/_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ def _agnosticcontextmanager(
def helper(*args: Pargs, **kwargs: Pkwargs) -> _AgnosticContextManager[R]:
return _AgnosticContextManager(func, args, kwargs)

return helper
# Ignoring the type to keep the original signature of the function
return helper # type: ignore[return-value]
2 changes: 1 addition & 1 deletion opentelemetry-api/src/opentelemetry/util/_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

def _load_provider(
provider_environment_variable: str, provider: str
) -> Provider:
) -> Provider: # type: ignore[type-var]

try:

Expand Down

0 comments on commit cb800f0

Please sign in to comment.