forked from pool/python-statsd
- 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
This commit is contained in:
@@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Nov 24 09:14:34 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- 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
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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')
|
||||
|
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e3e6db4c246f7c59003e51c9720a51a7f39a396541cb9b147ff4b14d15b5dd1f
|
||||
size 259045
|
3
statsd-4.0.1.tar.gz
Normal file
3
statsd-4.0.1.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:99763da81bfea8daf6b3d22d11aaccb01a8d0f52ea521daab37e758a4ca7d128
|
||||
size 27814
|
Reference in New Issue
Block a user