Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-prometheus-client for 
openSUSE:Factory checked in at 2022-06-05 21:28:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-prometheus-client (Old)
 and      /work/SRC/openSUSE:Factory/.python-prometheus-client.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-prometheus-client"

Sun Jun  5 21:28:44 2022 rev:6 rq:980909 version:0.14.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-prometheus-client/python-prometheus-client.changes
        2022-04-06 21:52:26.138920647 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-prometheus-client.new.1548/python-prometheus-client.changes
      2022-06-05 21:28:51.965073467 +0200
@@ -1,0 +2,7 @@
+Sat Jun  4 15:39:55 UTC 2022 - Michael Str??der <[email protected]>
+
+- Update to upstream 0.14.1 release
+  * [BUGFIX] Revert choose_encoder being renamed to choose_formatter
+    to fix a breaking change.
+
+-------------------------------------------------------------------

Old:
----
  v0.14.0.tar.gz

New:
----
  v0.14.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-prometheus-client.spec ++++++
--- /var/tmp/diff_new_pack.6SNxDY/_old  2022-06-05 21:28:52.501074188 +0200
+++ /var/tmp/diff_new_pack.6SNxDY/_new  2022-06-05 21:28:52.505074194 +0200
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-prometheus-client
-Version:        0.14.0
+Version:        0.14.1
 Release:        0
 Summary:        Python client for the Prometheus monitoring system
 License:        Apache-2.0

++++++ v0.14.0.tar.gz -> v0.14.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/client_python-0.14.0/prometheus_client/exposition.py 
new/client_python-0.14.1/prometheus_client/exposition.py
--- old/client_python-0.14.0/prometheus_client/exposition.py    2022-04-05 
22:57:11.000000000 +0200
+++ new/client_python-0.14.1/prometheus_client/exposition.py    2022-04-08 
18:04:07.000000000 +0200
@@ -13,6 +13,7 @@
 from urllib.request import (
     build_opener, HTTPHandler, HTTPRedirectHandler, Request,
 )
+import warnings
 from wsgiref.simple_server import make_server, WSGIRequestHandler, WSGIServer
 
 from .openmetrics import exposition as openmetrics
@@ -97,10 +98,10 @@
 def _bake_output(registry, accept_header, accept_encoding_header, params, 
disable_compression):
     """Bake output for metrics output."""
     # Choose the correct plain text format of the output.
-    formatter, content_type = choose_formatter(accept_header)
+    encoder, content_type = choose_encoder(accept_header)
     if 'name[]' in params:
         registry = registry.restricted_registry(params['name[]'])
-    output = formatter(registry)
+    output = encoder(registry)
     headers = [('Content-Type', content_type)]
     # If gzip encoding required, gzip the output.
     if not disable_compression and gzip_accepted(accept_encoding_header):
@@ -237,7 +238,7 @@
     return ''.join(output).encode('utf-8')
 
 
-def choose_formatter(accept_header: str) -> 
Tuple[Callable[[CollectorRegistry], bytes], str]:
+def choose_encoder(accept_header: str) -> Tuple[Callable[[CollectorRegistry], 
bytes], str]:
     accept_header = accept_header or ''
     for accepted in accept_header.split(','):
         if accepted.split(';')[0].strip() == 'application/openmetrics-text':
@@ -246,6 +247,15 @@
     return generate_latest, CONTENT_TYPE_LATEST
 
 
+def choose_formatter(accept_header: str) -> 
Tuple[Callable[[CollectorRegistry], bytes], str]:
+    warnings.warn(
+        "choose_formatter is deprecated and will be removed in 0.15.0, please 
use choose_encoder instead",
+        DeprecationWarning,
+        stacklevel=2
+    )
+    return choose_encoder(accept_header)
+
+
 def gzip_accepted(accept_encoding_header: str) -> bool:
     accept_encoding_header = accept_encoding_header or ''
     for accepted in accept_encoding_header.split(','):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/client_python-0.14.0/setup.py 
new/client_python-0.14.1/setup.py
--- old/client_python-0.14.0/setup.py   2022-04-05 22:57:11.000000000 +0200
+++ new/client_python-0.14.1/setup.py   2022-04-08 18:04:07.000000000 +0200
@@ -8,7 +8,7 @@
 
 setup(
     name="prometheus_client",
-    version="0.14.0",
+    version="0.14.1",
     author="Brian Brazil",
     author_email="[email protected]",
     description="Python client for the Prometheus monitoring system.",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/client_python-0.14.0/tests/test_exposition.py 
new/client_python-0.14.1/tests/test_exposition.py
--- old/client_python-0.14.0/tests/test_exposition.py   2022-04-05 
22:57:11.000000000 +0200
+++ new/client_python-0.14.1/tests/test_exposition.py   2022-04-08 
18:04:07.000000000 +0200
@@ -2,6 +2,7 @@
 import threading
 import time
 import unittest
+import warnings
 
 import pytest
 
@@ -12,9 +13,10 @@
 )
 from prometheus_client.core import GaugeHistogramMetricFamily, Timestamp
 from prometheus_client.exposition import (
-    basic_auth_handler, default_handler, MetricsHandler,
-    passthrough_redirect_handler,
+    basic_auth_handler, choose_encoder, choose_formatter, default_handler,
+    MetricsHandler, passthrough_redirect_handler,
 )
+import prometheus_client.openmetrics.exposition as openmetrics
 
 
 class TestGenerateText(unittest.TestCase):
@@ -460,5 +462,19 @@
     _expect_metric_exception(registry, error)
 
 
+def test_choose_encoder():
+    assert choose_encoder(None) == (generate_latest, CONTENT_TYPE_LATEST)
+    assert choose_encoder(CONTENT_TYPE_LATEST) == (generate_latest, 
CONTENT_TYPE_LATEST)
+    assert choose_encoder(openmetrics.CONTENT_TYPE_LATEST) == 
(openmetrics.generate_latest, openmetrics.CONTENT_TYPE_LATEST)
+
+
+def test_choose_formatter():
+    with warnings.catch_warnings(record=True) as w:
+        assert choose_formatter('') == (generate_latest, CONTENT_TYPE_LATEST)
+        assert len(w) == 1
+        assert issubclass(w[-1].category, DeprecationWarning)
+        assert "choose_formatter is deprecated" in str(w[-1].message)
+
+
 if __name__ == '__main__':
     unittest.main()

Reply via email to