From b635ce9592be2abb9e20d10b84e4006ddfd3ec5e63fc435af6d76cede4649357 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 24 Nov 2024 09:15:27 +0000 Subject: [PATCH] - update to 4.0.1: * Updated trove classifiers, see #174 - update to 4.0.0: * Updates support to Python 3.7 through 3.11. * Added `close()` method to UDP-based `StatsClient`. * Drops support for Python 2. * Using a timing decorator on an async function should now properly measure the execution time, instead of counting immediately. See #119. * Use pytest for the testsuite, and switch to bare asserts. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-statsd?expand=0&rev=16 --- python-statsd.changes | 15 ++++++++++++++- python-statsd.spec | 18 ++++++++++-------- remove-nose.patch | 36 ++++++++++++++---------------------- statsd-3.3.0.tar.gz | 3 --- statsd-4.0.1.tar.gz | 3 +++ 5 files changed, 41 insertions(+), 34 deletions(-) delete mode 100644 statsd-3.3.0.tar.gz create mode 100644 statsd-4.0.1.tar.gz diff --git a/python-statsd.changes b/python-statsd.changes index a7e509b..cec3c51 100644 --- a/python-statsd.changes +++ b/python-statsd.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sun Nov 24 09:14:34 UTC 2024 - Dirk Müller + +- update to 4.0.1: + * Updated trove classifiers, see #174 +- update to 4.0.0: + * Updates support to Python 3.7 through 3.11. + * Added `close()` method to UDP-based `StatsClient`. + * Drops support for Python 2. + * Using a timing decorator on an async function should now + properly measure the execution time, instead of counting + immediately. See #119. + ------------------------------------------------------------------- Tue Apr 19 10:54:18 UTC 2022 - pgajdos@suse.com @@ -7,7 +20,7 @@ Tue Apr 19 10:54:18 UTC 2022 - pgajdos@suse.com Tue Oct 5 04:43:33 UTC 2021 - Steve Kowalik - Add remove-nose.patch: - * Use pytest for the testsuite, and switch to bare asserts. + * Use pytest for the testsuite, and switch to bare asserts. ------------------------------------------------------------------- Sun Feb 24 08:54:55 UTC 2019 - John Vandenberg diff --git a/python-statsd.spec b/python-statsd.spec index 5db423f..7c45ca2 100644 --- a/python-statsd.spec +++ b/python-statsd.spec @@ -1,7 +1,7 @@ # # spec file for package python-statsd # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-statsd -Version: 3.3.0 +Version: 4.0.1 Release: 0 Summary: A simple statsd client License: MIT @@ -26,8 +26,10 @@ Group: Development/Languages/Python URL: https://github.com/jsocol/pystatsd Source: https://files.pythonhosted.org/packages/source/s/statsd/statsd-%{version}.tar.gz Patch0: remove-nose.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch @@ -38,14 +40,13 @@ statsd is a front-end to Graphite. This is a Python client for the statsd daemon. %prep -%setup -q -n statsd-%{version} -%autopatch -p1 +%autosetup -p1 -n statsd-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -55,7 +56,8 @@ sed -i 's:import mock:from unittest import mock:' statsd/tests.py %files %{python_files} %license LICENSE -%doc AUTHORS CHANGES README.rst docs/_build/html -%{python_sitelib}/* +%doc AUTHORS README.rst +%{python_sitelib}/statsd +%{python_sitelib}/statsd-%{version}.dist-info %changelog diff --git a/remove-nose.patch b/remove-nose.patch index 156eefc..52258ba 100644 --- a/remove-nose.patch +++ b/remove-nose.patch @@ -1,25 +1,17 @@ -Index: statsd-3.3.0/statsd/tests.py +Index: statsd-4.0.1/statsd/tests.py =================================================================== ---- statsd-3.3.0.orig/statsd/tests.py -+++ statsd-3.3.0/statsd/tests.py -@@ -7,7 +7,6 @@ from datetime import timedelta - from unittest import SkipTest - - import mock --from nose.tools import eq_ - - from statsd import StatsClient - from statsd import TCPStatsClient -@@ -66,7 +65,7 @@ def _unix_socket_client(prefix=None, soc +--- statsd-4.0.1.orig/statsd/tests.py ++++ statsd-4.0.1/statsd/tests.py +@@ -67,7 +67,7 @@ def _unix_socket_client(prefix=None, soc def _timer_check(sock, count, proto, start, end): send = send_method[proto](sock) - eq_(send.call_count, count) + assert send.call_count == count value = send.call_args[0][0].decode('ascii') - exp = re.compile('^%s:\d+|%s$' % (start, end)) + exp = re.compile(r'^%s:\d+|%s$' % (start, end)) assert exp.match(value) -@@ -74,14 +73,11 @@ def _timer_check(sock, count, proto, sta +@@ -75,14 +75,11 @@ def _timer_check(sock, count, proto, sta def _sock_check(sock, count, proto, val=None, addr=None): send = send_method[proto](sock) @@ -36,7 +28,7 @@ Index: statsd-3.3.0/statsd/tests.py class assert_raises(object): -@@ -443,7 +439,7 @@ def _test_prepare(cl, proto): +@@ -444,7 +441,7 @@ def _test_prepare(cl, proto): def _check(o, s, v, r): with mock.patch.object(random, 'random', lambda: -1): @@ -45,7 +37,7 @@ Index: statsd-3.3.0/statsd/tests.py for o, (s, v, r) in tests: _check(o, s, v, r) -@@ -519,31 +515,33 @@ def _test_timer_decorator(cl, proto): +@@ -520,31 +517,33 @@ def _test_timer_decorator(cl, proto): # make sure it works with more than one decorator, called multiple # times, and that parameters are handled correctly @@ -83,7 +75,7 @@ Index: statsd-3.3.0/statsd/tests.py assert isinstance(result.ms, float) -@@ -587,7 +585,7 @@ def test_timer_decorator_partial_functio +@@ -588,7 +587,7 @@ def test_timer_decorator_partial_functio foo = functools.partial(lambda x: x * x, 2) func = cl.timer('foo')(foo) @@ -92,7 +84,7 @@ Index: statsd-3.3.0/statsd/tests.py _timer_check(cl._sock, 1, 'tcp', 'foo', 'ms|@0.1') -@@ -601,16 +599,17 @@ def _test_timer_decorator_rate(cl, proto +@@ -602,16 +601,17 @@ def _test_timer_decorator_rate(cl, proto def bar(a, b=2, c=3): return [c, b, a] @@ -112,7 +104,7 @@ Index: statsd-3.3.0/statsd/tests.py cl = _udp_client() _test_timer_decorator_rate(cl, 'udp') -@@ -618,6 +617,7 @@ def test_timer_decorator_rate_udp(): +@@ -619,6 +619,7 @@ def test_timer_decorator_rate_udp(): @mock.patch.object(random, 'random', lambda: -1) def test_timer_decorator_rate_tcp(): """TCPStatsClient.timer can be used as decorator with rate.""" @@ -120,7 +112,7 @@ Index: statsd-3.3.0/statsd/tests.py cl = _tcp_client() _test_timer_decorator_rate(cl, 'tcp') -@@ -906,8 +906,8 @@ def test_pipeline_timer_object_tcp(): +@@ -931,8 +932,8 @@ def test_pipeline_timer_object_tcp(): def _test_pipeline_empty(cl): with cl.pipeline() as pipe: pipe.incr('foo') @@ -131,7 +123,7 @@ Index: statsd-3.3.0/statsd/tests.py def test_pipeline_empty_udp(): -@@ -1006,7 +1006,7 @@ def test_pipeline_packet_size(): +@@ -1031,7 +1032,7 @@ def test_pipeline_packet_size(): # 32 * 16 = 512, so this will need 2 packets. pipe.incr('sixteen_char_str') pipe.send() @@ -140,7 +132,7 @@ Index: statsd-3.3.0/statsd/tests.py assert len(sc._sock.sendto.call_args_list[0][0][0]) <= 512 assert len(sc._sock.sendto.call_args_list[1][0][0]) <= 512 -@@ -1017,7 +1017,7 @@ def test_tcp_raises_exception_to_user(mo +@@ -1042,7 +1043,7 @@ def test_tcp_raises_exception_to_user(mo addr = ('127.0.0.1', 1234) cl = _tcp_client(addr=addr[0], port=addr[1]) cl.incr('foo') diff --git a/statsd-3.3.0.tar.gz b/statsd-3.3.0.tar.gz deleted file mode 100644 index a7768e6..0000000 --- a/statsd-3.3.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e3e6db4c246f7c59003e51c9720a51a7f39a396541cb9b147ff4b14d15b5dd1f -size 259045 diff --git a/statsd-4.0.1.tar.gz b/statsd-4.0.1.tar.gz new file mode 100644 index 0000000..1bba685 --- /dev/null +++ b/statsd-4.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99763da81bfea8daf6b3d22d11aaccb01a8d0f52ea521daab37e758a4ca7d128 +size 27814