commit python-opentelemetry-api for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-opentelemetry-api for openSUSE:Factory checked in at 2025-01-09 15:05:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-opentelemetry-api (Old) and /work/SRC/openSUSE:Factory/.python-opentelemetry-api.new.1881 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-opentelemetry-api" Thu Jan 9 15:05:54 2025 rev:16 rq:1235914 version:1.29.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-opentelemetry-api/python-opentelemetry-api.changes 2024-09-04 13:22:37.384742858 +0200 +++ /work/SRC/openSUSE:Factory/.python-opentelemetry-api.new.1881/python-opentelemetry-api.changes 2025-01-09 15:06:34.510150078 +0100 @@ -1,0 +2,32 @@ +Wed Jan 8 12:00:10 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com> + +- Update to 1.29.0 + * Fix crash exporting a log record with None body + * Fix metrics export with exemplar and no context and filtering observable instruments + * Fix recursion error with sdk disabled and handler added to root logger + * sdk: setup EventLogger when OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED is set + * api: fix logging of duplicate EventLogger setup warning + * sdk: fix setting of process owner in ProcessResourceDetector + * sdk: fix serialization of logs severity_number field to int + * Remove `TestBase.assertEqualSpanInstrumentationInfo` method, + use `assertEqualSpanInstrumentationScope` instead + * sdk: instantiate lazily `ExemplarBucket`s in `ExemplarReservoir`s + * semantic-conventions: Bump to 1.29.0 +- from version 1.28.0 + * Removed superfluous py.typed markers and added them where they were missing + * Include metric info in encoding exceptions + * sdk: Add support for log formatting + * sdk: Add Host resource detector + * sdk: Implementation of exemplars + * Implement events sdk + * Update semantic conventions to version 1.28.0 + * Add support to protobuf 5+ and drop support to protobuf 3 and 4 + * Update environment variable descriptions to match signal + * Record logger name as the instrumentation scope name + * Fix memory leak in exporter and reader + * Drop `OTEL_PYTHON_EXPERIMENTAL_DISABLE_PROMETHEUS_UNIT_NORMALIZATION` environment variable + * Improve compatibility with other logging libraries that override + `LogRecord.getMessage()` in order to customize message formatting +- Update BuildRequires from pyproject.toml + +------------------------------------------------------------------- Old: ---- opentelemetry_api-1.27.0.tar.gz New: ---- opentelemetry_api-1.29.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-opentelemetry-api.spec ++++++ --- /var/tmp/diff_new_pack.nUL8Zj/_old 2025-01-09 15:06:35.046172369 +0100 +++ /var/tmp/diff_new_pack.nUL8Zj/_new 2025-01-09 15:06:35.046172369 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-opentelemetry-api # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,7 +27,7 @@ %{?sle15_python_module_pythons} Name: python-opentelemetry-api%{?psuffix} -Version: 1.27.0 +Version: 1.29.0 Release: 0 Summary: OpenTelemetry Python API License: Apache-2.0 @@ -51,7 +51,7 @@ %endif %if %{with test} BuildRequires: %{python_module opentelemetry-api = %{version}} -BuildRequires: %{python_module opentelemetry-test-utils == 0.48b0} +BuildRequires: %{python_module opentelemetry-test-utils == 0.50b0} BuildRequires: %{python_module pytest} %endif %python_subpackages ++++++ opentelemetry_api-1.27.0.tar.gz -> opentelemetry_api-1.29.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/PKG-INFO new/opentelemetry_api-1.29.0/PKG-INFO --- old/opentelemetry_api-1.27.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,11 +1,10 @@ Metadata-Version: 2.3 Name: opentelemetry-api -Version: 1.27.0 +Version: 1.29.0 Summary: OpenTelemetry Python API Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemet... Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io> License: Apache-2.0 -License-File: LICENSE Classifier: Development Status :: 5 - Production/Stable Classifier: Framework :: OpenTelemetry Classifier: Intended Audience :: Developers @@ -20,7 +19,7 @@ Classifier: Typing :: Typed Requires-Python: >=3.8 Requires-Dist: deprecated>=1.2.6 -Requires-Dist: importlib-metadata<=8.4.0,>=6.0 +Requires-Dist: importlib-metadata<=8.5.0,>=6.0 Description-Content-Type: text/x-rst OpenTelemetry Python API diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/pyproject.toml new/opentelemetry_api-1.29.0/pyproject.toml --- old/opentelemetry_api-1.27.0/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -29,7 +29,7 @@ "Deprecated >= 1.2.6", # FIXME This should be able to be removed after 3.12 is released if there is a reliable API # in importlib.metadata. - "importlib-metadata >= 6.0, <= 8.4.0", + "importlib-metadata >= 6.0, <= 8.5.0", ] dynamic = [ "version", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/_events/__init__.py new/opentelemetry_api-1.29.0/src/opentelemetry/_events/__init__.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/_events/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/_events/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -31,7 +31,6 @@ class Event(LogRecord): - def __init__( self, name: str, @@ -58,7 +57,6 @@ class EventLogger(ABC): - def __init__( self, name: str, @@ -77,7 +75,6 @@ class NoOpEventLogger(EventLogger): - def emit(self, event: Event) -> None: pass @@ -119,7 +116,6 @@ class EventLoggerProvider(ABC): - @abstractmethod def get_event_logger( self, @@ -132,7 +128,6 @@ class NoOpEventLoggerProvider(EventLoggerProvider): - def get_event_logger( self, name: str, @@ -146,7 +141,6 @@ class ProxyEventLoggerProvider(EventLoggerProvider): - def get_event_logger( self, name: str, @@ -175,7 +169,6 @@ def get_event_logger_provider() -> EventLoggerProvider: - global _EVENT_LOGGER_PROVIDER # pylint: disable=global-variable-not-assigned if _EVENT_LOGGER_PROVIDER is None: if _OTEL_PYTHON_EVENT_LOGGER_PROVIDER not in environ: @@ -199,7 +192,7 @@ did_set = _EVENT_LOGGER_PROVIDER_SET_ONCE.do_once(set_elp) - if log and did_set: + if log and not did_set: _logger.warning( "Overriding of current EventLoggerProvider is not allowed" ) @@ -208,7 +201,6 @@ def set_event_logger_provider( event_logger_provider: EventLoggerProvider, ) -> None: - _set_event_logger_provider(event_logger_provider, log=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/context/__init__.py new/opentelemetry_api-1.29.0/src/opentelemetry/context/__init__.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/context/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/context/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -37,9 +37,7 @@ # environment variables default_context = "contextvars_context" - configured_context = environ.get( - OTEL_PYTHON_CONTEXT, default_context - ) # type: str + configured_context = environ.get(OTEL_PYTHON_CONTEXT, default_context) # type: str try: return next( # type: ignore diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/metrics/__init__.py new/opentelemetry_api-1.29.0/src/opentelemetry/metrics/__init__.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/metrics/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/metrics/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -53,15 +53,9 @@ CallbackOptions, CallbackT, Counter, -) -from opentelemetry.metrics._internal.instrument import Gauge as _Gauge -from opentelemetry.metrics._internal.instrument import ( Histogram, Instrument, NoOpCounter, -) -from opentelemetry.metrics._internal.instrument import NoOpGauge as _NoOpGauge -from opentelemetry.metrics._internal.instrument import ( NoOpHistogram, NoOpObservableCounter, NoOpObservableGauge, @@ -73,6 +67,8 @@ Synchronous, UpDownCounter, ) +from opentelemetry.metrics._internal.instrument import Gauge as _Gauge +from opentelemetry.metrics._internal.instrument import NoOpGauge as _NoOpGauge from opentelemetry.metrics._internal.observation import Observation for obj in [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/metrics/_internal/__init__.py new/opentelemetry_api-1.29.0/src/opentelemetry/metrics/_internal/__init__.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/metrics/_internal/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/metrics/_internal/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -40,7 +40,6 @@ .. versionadded:: 1.10.0 """ - import warnings from abc import ABC, abstractmethod from logging import getLogger diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/metrics/_internal/instrument.py new/opentelemetry_api-1.29.0/src/opentelemetry/metrics/_internal/instrument.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/metrics/_internal/instrument.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/metrics/_internal/instrument.py 2020-02-02 01:00:00.000000000 +0100 @@ -33,6 +33,7 @@ # pylint: disable=unused-import; needed for typing and sphinx from opentelemetry import metrics +from opentelemetry.context import Context from opentelemetry.metrics._internal.observation import Observation from opentelemetry.util.types import Attributes @@ -173,6 +174,7 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: pass @@ -192,8 +194,9 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: - return super().add(amount, attributes=attributes) + return super().add(amount, attributes=attributes, context=context) class _ProxyCounter(_ProxyInstrument[Counter], Counter): @@ -201,9 +204,10 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: if self._real_instrument: - self._real_instrument.add(amount, attributes) + self._real_instrument.add(amount, attributes, context) def _create_real_instrument(self, meter: "metrics.Meter") -> Counter: return meter.create_counter(self._name, self._unit, self._description) @@ -217,6 +221,7 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: pass @@ -236,8 +241,9 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: - return super().add(amount, attributes=attributes) + return super().add(amount, attributes=attributes, context=context) class _ProxyUpDownCounter(_ProxyInstrument[UpDownCounter], UpDownCounter): @@ -245,9 +251,10 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: if self._real_instrument: - self._real_instrument.add(amount, attributes) + self._real_instrument.add(amount, attributes, context) def _create_real_instrument(self, meter: "metrics.Meter") -> UpDownCounter: return meter.create_up_down_counter( @@ -328,6 +335,7 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: pass @@ -347,8 +355,9 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: - return super().record(amount, attributes=attributes) + return super().record(amount, attributes=attributes, context=context) class _ProxyHistogram(_ProxyInstrument[Histogram], Histogram): @@ -356,9 +365,10 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: if self._real_instrument: - self._real_instrument.record(amount, attributes) + self._real_instrument.record(amount, attributes, context) def _create_real_instrument(self, meter: "metrics.Meter") -> Histogram: return meter.create_histogram( @@ -406,6 +416,7 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: pass @@ -425,8 +436,9 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: - return super().set(amount, attributes=attributes) + return super().set(amount, attributes=attributes, context=context) class _ProxyGauge( @@ -437,9 +449,10 @@ self, amount: Union[int, float], attributes: Optional[Attributes] = None, + context: Optional[Context] = None, ) -> None: if self._real_instrument: - self._real_instrument.set(amount, attributes) + self._real_instrument.set(amount, attributes, context) def _create_real_instrument(self, meter: "metrics.Meter") -> Gauge: return meter.create_gauge(self._name, self._unit, self._description) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/metrics/_internal/observation.py new/opentelemetry_api-1.29.0/src/opentelemetry/metrics/_internal/observation.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/metrics/_internal/observation.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/metrics/_internal/observation.py 2020-02-02 01:00:00.000000000 +0100 @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Union +from typing import Optional, Union +from opentelemetry.context import Context from opentelemetry.util.types import Attributes @@ -25,13 +26,18 @@ Args: value: The float or int measured value attributes: The measurement's attributes + context: The measurement's context """ def __init__( - self, value: Union[int, float], attributes: Attributes = None + self, + value: Union[int, float], + attributes: Attributes = None, + context: Optional[Context] = None, ) -> None: self._value = value self._attributes = attributes + self._context = context @property def value(self) -> Union[float, int]: @@ -41,12 +47,17 @@ def attributes(self) -> Attributes: return self._attributes + @property + def context(self) -> Optional[Context]: + return self._context + def __eq__(self, other: object) -> bool: return ( isinstance(other, Observation) and self.value == other.value and self.attributes == other.attributes + and self.context == other.context ) def __repr__(self) -> str: - return f"Observation(value={self.value}, attributes={self.attributes})" + return f"Observation(value={self.value}, attributes={self.attributes}, context={self.context})" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/propagate/__init__.py new/opentelemetry_api-1.29.0/src/opentelemetry/propagate/__init__.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/propagate/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/propagate/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -134,7 +134,6 @@ propagator = propagator.strip() try: - propagators.append( # type: ignore next( # type: ignore iter( # type: ignore diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/trace/__init__.py new/opentelemetry_api-1.29.0/src/opentelemetry/trace/__init__.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/trace/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/trace/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -73,7 +73,6 @@ `set_tracer_provider`. """ - import os import typing from abc import ABC, abstractmethod diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/trace/span.py new/opentelemetry_api-1.29.0/src/opentelemetry/trace/span.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/trace/span.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/trace/span.py 2020-02-02 01:00:00.000000000 +0100 @@ -45,7 +45,6 @@ def _is_valid_pair(key: str, value: str) -> bool: - return ( isinstance(key, str) and _KEY_PATTERN.fullmatch(key) is not None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/util/_decorator.py new/opentelemetry_api-1.29.0/src/opentelemetry/util/_decorator.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/util/_decorator.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/util/_decorator.py 2020-02-02 01:00:00.000000000 +0100 @@ -30,7 +30,8 @@ class _AgnosticContextManager( - contextlib._GeneratorContextManager, Generic[R] # type: ignore # FIXME use contextlib._GeneratorContextManager[R] when we drop the python 3.8 support + contextlib._GeneratorContextManager, # type: ignore # FIXME use contextlib._GeneratorContextManager[R] when we drop the python 3.8 support + Generic[R], ): # pylint: disable=protected-access """Context manager that can decorate both async and sync functions. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/util/_importlib_metadata.py new/opentelemetry_api-1.29.0/src/opentelemetry/util/_importlib_metadata.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/util/_importlib_metadata.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/util/_importlib_metadata.py 2020-02-02 01:00:00.000000000 +0100 @@ -15,15 +15,23 @@ # FIXME: Use importlib.metadata when support for 3.11 is dropped if the rest of # the supported versions at that time have the same API. from importlib_metadata import ( # type: ignore + Distribution, EntryPoint, EntryPoints, + PackageNotFoundError, + distributions, entry_points, + requires, version, ) -# The importlib-metadata library has introduced breaking changes before to its -# API, this module is kept just to act as a layer between the -# importlib-metadata library and our project if in any case it is necessary to -# do so. - -__all__ = ["entry_points", "version", "EntryPoint", "EntryPoints"] +__all__ = [ + "entry_points", + "version", + "EntryPoint", + "EntryPoints", + "requires", + "Distribution", + "distributions", + "PackageNotFoundError", +] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/util/_providers.py new/opentelemetry_api-1.29.0/src/opentelemetry/util/_providers.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/util/_providers.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/util/_providers.py 2020-02-02 01:00:00.000000000 +0100 @@ -30,9 +30,7 @@ def _load_provider( provider_environment_variable: str, provider: str ) -> Provider: # type: ignore[type-var] - try: - provider_name = cast( str, environ.get(provider_environment_variable, f"default_{provider}"), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/util/types.py new/opentelemetry_api-1.29.0/src/opentelemetry/util/types.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/util/types.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/util/types.py 2020-02-02 01:00:00.000000000 +0100 @@ -15,6 +15,20 @@ from typing import Mapping, Optional, Sequence, Tuple, Union +# This is the implementation of the "Any" type as specified by the specifications of OpenTelemetry data model for logs. +# For more details, refer to the OTel specification: +# https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec... +AnyValue = Union[ + str, + bool, + int, + float, + bytes, + Sequence["AnyValue"], + Mapping[str, "AnyValue"], + None, +] + AttributeValue = Union[ str, bool, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/src/opentelemetry/version/__init__.py new/opentelemetry_api-1.29.0/src/opentelemetry/version/__init__.py --- old/opentelemetry_api-1.27.0/src/opentelemetry/version/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/src/opentelemetry/version/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.27.0" +__version__ = "1.29.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/events/test_event_logger_provider.py new/opentelemetry_api-1.29.0/tests/events/test_event_logger_provider.py --- old/opentelemetry_api-1.27.0/tests/events/test_event_logger_provider.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/events/test_event_logger_provider.py 2020-02-02 01:00:00.000000000 +0100 @@ -11,13 +11,28 @@ class TestGlobals(EventsGlobalsTest, unittest.TestCase): - def test_set_event_logger_provider(self): + @patch("opentelemetry._events._logger") + def test_set_event_logger_provider(self, logger_mock): elp_mock = Mock() # pylint: disable=protected-access self.assertIsNone(events._EVENT_LOGGER_PROVIDER) set_event_logger_provider(elp_mock) self.assertIs(events._EVENT_LOGGER_PROVIDER, elp_mock) self.assertIs(get_event_logger_provider(), elp_mock) + logger_mock.warning.assert_not_called() + + # pylint: disable=no-self-use + @patch("opentelemetry._events._logger") + def test_set_event_logger_provider_will_warn_second_call( + self, logger_mock + ): + elp_mock = Mock() + set_event_logger_provider(elp_mock) + set_event_logger_provider(elp_mock) + + logger_mock.warning.assert_called_once_with( + "Overriding of current EventLoggerProvider is not allowed" + ) def test_get_event_logger_provider(self): # pylint: disable=protected-access @@ -35,7 +50,6 @@ "OTEL_PYTHON_EVENT_LOGGER_PROVIDER": "test_event_logger_provider" }, ): - with patch("opentelemetry._events._load_provider", Mock()): with patch( "opentelemetry._events.cast", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/logs/test_logger_provider.py new/opentelemetry_api-1.29.0/tests/logs/test_logger_provider.py --- old/opentelemetry_api-1.27.0/tests/logs/test_logger_provider.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/logs/test_logger_provider.py 2020-02-02 01:00:00.000000000 +0100 @@ -53,7 +53,6 @@ "os.environ", {_OTEL_PYTHON_LOGGER_PROVIDER: "test_logger_provider"}, ): - with patch("opentelemetry._logs._internal._load_provider", Mock()): with patch( "opentelemetry._logs._internal.cast", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/metrics/test_instruments.py new/opentelemetry_api-1.29.0/tests/metrics/test_instruments.py --- old/opentelemetry_api-1.27.0/tests/metrics/test_instruments.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/metrics/test_instruments.py 2020-02-02 01:00:00.000000000 +0100 @@ -677,7 +677,6 @@ ) def test_unit_check(self): - instrument = ChildInstrument("name") self.assertEqual( @@ -711,7 +710,6 @@ ) def test_description_check(self): - instrument = ChildInstrument("name") self.assertEqual( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/metrics/test_meter.py new/opentelemetry_api-1.29.0/tests/metrics/test_meter.py --- old/opentelemetry_api-1.27.0/tests/metrics/test_meter.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/metrics/test_meter.py 2020-02-02 01:00:00.000000000 +0100 @@ -63,7 +63,6 @@ class TestMeter(TestCase): # pylint: disable=no-member def test_repeated_instrument_names(self): - try: test_meter = NoOpMeter("name") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/metrics/test_meter_provider.py new/opentelemetry_api-1.29.0/tests/metrics/test_meter_provider.py --- old/opentelemetry_api-1.27.0/tests/metrics/test_meter_provider.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/metrics/test_meter_provider.py 2020-02-02 01:00:00.000000000 +0100 @@ -98,7 +98,6 @@ with patch.dict( "os.environ", {OTEL_PYTHON_METER_PROVIDER: "test_meter_provider"} ): - with patch("opentelemetry.metrics._internal._load_provider", Mock()): with patch( "opentelemetry.metrics._internal.cast", @@ -279,13 +278,15 @@ real_gauge.assert_not_called() proxy_counter.add(amount, attributes=attributes) - real_counter.add.assert_called_once_with(amount, attributes) + real_counter.add.assert_called_once_with(amount, attributes, None) proxy_updowncounter.add(amount, attributes=attributes) - real_updowncounter.add.assert_called_once_with(amount, attributes) + real_updowncounter.add.assert_called_once_with( + amount, attributes, None + ) proxy_histogram.record(amount, attributes=attributes) - real_histogram.record.assert_called_once_with(amount, attributes) + real_histogram.record.assert_called_once_with(amount, attributes, None) proxy_gauge.set(amount, attributes=attributes) - real_gauge.set.assert_called_once_with(amount, attributes) + real_gauge.set.assert_called_once_with(amount, attributes, None) def test_proxy_meter_with_real_meter(self) -> None: # Creating new instruments on the _ProxyMeter with a real meter set diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/propagators/test_propagators.py new/opentelemetry_api-1.29.0/tests/propagators/test_propagators.py --- old/opentelemetry_api-1.27.0/tests/propagators/test_propagators.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/propagators/test_propagators.py 2020-02-02 01:00:00.000000000 +0100 @@ -32,7 +32,6 @@ @patch("opentelemetry.propagators.composite.CompositePropagator") def test_default_composite_propagators(self, mock_compositehttppropagator): def test_propagators(propagators): - propagators = {propagator.__class__ for propagator in propagators} self.assertEqual(len(propagators), 2) @@ -56,7 +55,6 @@ def test_non_default_propagators( self, mock_entry_points, mock_compositehttppropagator ): - mock_entry_points.configure_mock( **{ "side_effect": [ @@ -107,7 +105,6 @@ environ, {OTEL_PROPAGATORS: "tracecontext , unknown , baggage"} ) def test_composite_propagators_error(self): - with self.assertRaises(ValueError) as cm: # pylint: disable=import-outside-toplevel import opentelemetry.propagate diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/propagators/test_w3cbaggagepropagator.py new/opentelemetry_api-1.29.0/tests/propagators/test_w3cbaggagepropagator.py --- old/opentelemetry_api-1.27.0/tests/propagators/test_w3cbaggagepropagator.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/propagators/test_w3cbaggagepropagator.py 2020-02-02 01:00:00.000000000 +0100 @@ -130,7 +130,6 @@ ) def test_header_max_entries_skip_invalid_entry(self): - with self.assertLogs(level=WARNING) as warning: self.assertEqual( self._extract( @@ -227,7 +226,6 @@ @patch("opentelemetry.baggage.propagation.get_all") @patch("opentelemetry.baggage.propagation._format_baggage") def test_fields(self, mock_format_baggage, mock_baggage): - mock_setter = Mock() self.propagator.inject({}, setter=mock_setter) @@ -250,7 +248,6 @@ @patch("opentelemetry.baggage._BAGGAGE_KEY", new="abc") def test_inject_extract(self): - carrier = {} context = set_baggage( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/trace/propagation/test_tracecontexthttptextformat.py new/opentelemetry_api-1.29.0/tests/trace/propagation/test_tracecontexthttptextformat.py --- old/opentelemetry_api-1.27.0/tests/trace/propagation/test_tracecontexthttptextformat.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/trace/propagation/test_tracecontexthttptextformat.py 2020-02-02 01:00:00.000000000 +0100 @@ -245,7 +245,6 @@ @patch("opentelemetry.trace.INVALID_SPAN_CONTEXT") @patch("opentelemetry.trace.get_current_span") def test_fields(self, mock_get_current_span, mock_invalid_span_context): - mock_get_current_span.configure_mock( return_value=Mock( **{ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/trace/test_globals.py new/opentelemetry_api-1.29.0/tests/trace/test_globals.py --- old/opentelemetry_api-1.27.0/tests/trace/test_globals.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/trace/test_globals.py 2020-02-02 01:00:00.000000000 +0100 @@ -111,7 +111,6 @@ self.assertEqual(trace.get_current_span(), trace.INVALID_SPAN) def test_use_span_end_on_exit(self): - test_span = SpanTest(trace.INVALID_SPAN_CONTEXT) with trace.use_span(test_span): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/trace/test_status.py new/opentelemetry_api-1.29.0/tests/trace/test_status.py --- old/opentelemetry_api-1.27.0/tests/trace/test_status.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/trace/test_status.py 2020-02-02 01:00:00.000000000 +0100 @@ -30,7 +30,10 @@ def test_invalid_description(self): with self.assertLogs(level=WARNING) as warning: - status = Status(status_code=StatusCode.ERROR, description={"test": "val"}) # type: ignore + status = Status( + status_code=StatusCode.ERROR, + description={"test": "val"}, # type: ignore + ) self.assertIs(status.status_code, StatusCode.ERROR) self.assertEqual(status.description, None) self.assertIn( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/util/test__importlib_metadata.py new/opentelemetry_api-1.29.0/tests/util/test__importlib_metadata.py --- old/opentelemetry_api-1.27.0/tests/util/test__importlib_metadata.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/util/test__importlib_metadata.py 2020-02-02 01:00:00.000000000 +0100 @@ -15,7 +15,11 @@ from unittest import TestCase from opentelemetry.metrics import MeterProvider -from opentelemetry.util._importlib_metadata import EntryPoint, EntryPoints +from opentelemetry.util._importlib_metadata import ( + EntryPoint, + EntryPoints, + version, +) from opentelemetry.util._importlib_metadata import ( entry_points as importlib_metadata_entry_points, ) @@ -23,7 +27,6 @@ class TestEntryPoints(TestCase): def test_entry_points(self): - self.assertIsInstance( next( iter( @@ -106,3 +109,5 @@ entry_points = importlib_metadata_entry_points(group="abc", name="abc") self.assertIsInstance(entry_points, EntryPoints) self.assertEqual(len(entry_points), 0) + + self.assertIsInstance(version("opentelemetry-api"), str) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opentelemetry_api-1.27.0/tests/util/test__providers.py new/opentelemetry_api-1.29.0/tests/util/test__providers.py --- old/opentelemetry_api-1.27.0/tests/util/test__providers.py 2020-02-02 01:00:00.000000000 +0100 +++ new/opentelemetry_api-1.29.0/tests/util/test__providers.py 2020-02-02 01:00:00.000000000 +0100 @@ -29,7 +29,6 @@ ) @patch("opentelemetry.util._importlib_metadata.entry_points") def test__providers(self, mock_entry_points): - reload(_providers) mock_entry_points.configure_mock(
participants (1)
-
Source-Sync