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

Bump mypy to 1.9.0 #3795

Merged
merged 8 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,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 @@ -21,6 +19,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)
xrmx marked this conversation as resolved.
Show resolved Hide resolved
return NoOpLogger(name, version=version, schema_url=schema_url)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,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 @@ -598,7 +597,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 @@ -619,7 +617,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 @@ -640,9 +637,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 @@ -664,9 +658,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 @@ -692,7 +683,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 @@ -714,9 +704,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 @@ -743,9 +730,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
Loading