diff --git a/CHANGELOG.md b/CHANGELOG.md index bc9a8dd77da..190fbc489a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,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) diff --git a/dev-requirements.txt b/dev-requirements.txt index 15462dea502..01f46ae87e9 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -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 diff --git a/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py b/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py index 156b2598e47..ccf9f4597aa 100644 --- a/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py +++ b/opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py @@ -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) diff --git a/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py b/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py index 1579a1a2445..9cbf14d2edc 100644 --- a/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py +++ b/opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py @@ -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) @@ -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]: @@ -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 ]: @@ -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]: @@ -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]: @@ -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]: @@ -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]: @@ -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]: diff --git a/opentelemetry-api/src/opentelemetry/util/_decorator.py b/opentelemetry-api/src/opentelemetry/util/_decorator.py index 233f29ff79d..870c97bd989 100644 --- a/opentelemetry-api/src/opentelemetry/util/_decorator.py +++ b/opentelemetry-api/src/opentelemetry/util/_decorator.py @@ -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] diff --git a/opentelemetry-api/src/opentelemetry/util/_providers.py b/opentelemetry-api/src/opentelemetry/util/_providers.py index d255ac999f0..307650bb1d2 100644 --- a/opentelemetry-api/src/opentelemetry/util/_providers.py +++ b/opentelemetry-api/src/opentelemetry/util/_providers.py @@ -29,7 +29,7 @@ def _load_provider( provider_environment_variable: str, provider: str -) -> Provider: +) -> Provider: # type: ignore[type-var] try: