Hello community,
here is the log from the commit of package python-prometheus_client for
openSUSE:Factory checked in at 2019-07-23 22:39:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-prometheus_client (Old)
and /work/SRC/openSUSE:Factory/.python-prometheus_client.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-prometheus_client"
Tue Jul 23 22:39:26 2019 rev:5 rq:717851 version:0.7.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-prometheus_client/python-prometheus_client.changes
2019-06-20 19:04:43.437612233 +0200
+++
/work/SRC/openSUSE:Factory/.python-prometheus_client.new.4126/python-prometheus_client.changes
2019-07-23 22:39:27.322945650 +0200
@@ -1,0 +2,7 @@
+Tue Jul 23 11:11:01 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 0.7.1:
+ * [BUGFIX] multiprocess: don't crash on missing gauge_live/sum files (#424)
+ * [BUGFIX] correctly bind method on Python 2.x (#403)
+
+-------------------------------------------------------------------
Old:
----
v0.7.0.tar.gz
New:
----
v0.7.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-prometheus_client.spec ++++++
--- /var/tmp/diff_new_pack.QNzjAm/_old 2019-07-23 22:39:28.006945509 +0200
+++ /var/tmp/diff_new_pack.QNzjAm/_new 2019-07-23 22:39:28.010945508 +0200
@@ -18,18 +18,18 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-prometheus_client
-Version: 0.7.0
+Version: 0.7.1
Release: 0
Summary: Python client for the Prometheus monitoring system
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/prometheus/client_python
-#Source:
https://files.pythonhosted.org/packages/source/p/prometheus_client/prometheus_client-%{version}.tar.gz
Source:
https://github.com/prometheus/client_python/archive/v%{version}.tar.gz
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
+BuildRequires: python2-futures
Suggests: python-twisted
BuildArch: noarch
%python_subpackages
@@ -48,9 +48,7 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
-# test_core.py needs concurrent.futures, which is only in python3
-py.test2 --ignore=tests/test_core.py tests
-py.test3 tests
+%pytest
%files %{python_files}
%doc README.md
++++++ v0.7.0.tar.gz -> v0.7.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/client_python-0.7.0/prometheus_client/metrics.py
new/client_python-0.7.1/prometheus_client/metrics.py
--- old/client_python-0.7.0/prometheus_client/metrics.py 2019-06-07
12:36:14.000000000 +0200
+++ new/client_python-0.7.1/prometheus_client/metrics.py 2019-06-20
15:33:44.000000000 +0200
@@ -14,6 +14,10 @@
if sys.version_info > (3,):
unicode = str
+ create_bound_method = types.MethodType
+else:
+ def create_bound_method(func, obj):
+ return types.MethodType(func, obj, obj.__class__)
def _build_full_name(metric_type, name, namespace, subsystem, unit):
@@ -369,7 +373,7 @@
def samples(self):
return (('', {}, float(f())),)
- self._child_samples = types.MethodType(samples, self)
+ self._child_samples = create_bound_method(samples, self)
def _child_samples(self):
return (('', {}, self._value.get()),)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/client_python-0.7.0/prometheus_client/multiprocess.py
new/client_python-0.7.1/prometheus_client/multiprocess.py
--- old/client_python-0.7.0/prometheus_client/multiprocess.py 2019-06-07
12:36:14.000000000 +0200
+++ new/client_python-0.7.1/prometheus_client/multiprocess.py 2019-06-20
15:33:44.000000000 +0200
@@ -12,6 +12,11 @@
from .samples import Sample
from .utils import floatToGoString
+try: # Python3
+ FileNotFoundError
+except NameError: # Python >= 2.5
+ FileNotFoundError = IOError
+
MP_METRIC_HELP = 'Multiprocess metric'
@@ -54,7 +59,16 @@
for f in files:
parts = os.path.basename(f).split('_')
typ = parts[0]
- for key, value, pos in MmapedDict.read_all_values_from_file(f):
+ try:
+ file_values = MmapedDict.read_all_values_from_file(f)
+ except FileNotFoundError:
+ if typ == 'gauge' and parts[1] in ('liveall', 'livesum'):
+ # Those files can disappear between the glob of collect
+ # and now (via a mark_process_dead call) so don't fail if
+ # the file is missing
+ continue
+ raise
+ for key, value, pos in file_values:
metric_name, name, labels, labels_key = _parse_key(key)
metric = metrics.get(metric_name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/client_python-0.7.0/setup.py
new/client_python-0.7.1/setup.py
--- old/client_python-0.7.0/setup.py 2019-06-07 12:36:14.000000000 +0200
+++ new/client_python-0.7.1/setup.py 2019-06-20 15:33:44.000000000 +0200
@@ -2,7 +2,7 @@
setup(
name="prometheus_client",
- version="0.7.0",
+ version="0.7.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.7.0/tests/test_multiprocess.py
new/client_python-0.7.1/tests/test_multiprocess.py
--- old/client_python-0.7.0/tests/test_multiprocess.py 2019-06-07
12:36:14.000000000 +0200
+++ new/client_python-0.7.1/tests/test_multiprocess.py 2019-06-20
15:33:44.000000000 +0200
@@ -270,6 +270,16 @@
self.assertEqual(metrics['h'].samples, expected_histogram)
+ def test_missing_gauge_file_during_merge(self):
+ # These files don't exist, just like if mark_process_dead(9999999) had
been
+ # called during self.collector.collect(), after the glob found it
+ # but before the merge actually happened.
+ # This should not raise and return no metrics
+ self.assertFalse(self.collector.merge([
+ os.path.join(self.tempdir, 'gauge_liveall_9999999.db'),
+ os.path.join(self.tempdir, 'gauge_livesum_9999999.db'),
+ ]))
+
class TestMmapedDict(unittest.TestCase):
def setUp(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/client_python-0.7.0/tox.ini
new/client_python-0.7.1/tox.ini
--- old/client_python-0.7.0/tox.ini 2019-06-07 12:36:14.000000000 +0200
+++ new/client_python-0.7.1/tox.ini 2019-06-20 15:33:44.000000000 +0200
@@ -29,7 +29,7 @@
[testenv]
deps =
{[base]deps}
- {py27,py34,py35,py36,pypy,pypy3}: twisted
+ {py27,py37,pypy,pypy3}: twisted
commands = coverage run --parallel -m pytest {posargs}
; Ensure test suite passes if no optional dependencies are present.