commit python-scales for openSUSE:Factory

2020-08-18 Thread root
Hello community,

here is the log from the commit of package python-scales for openSUSE:Factory 
checked in at 2020-08-18 15:08:13

Comparing /work/SRC/openSUSE:Factory/python-scales (Old)
 and  /work/SRC/openSUSE:Factory/.python-scales.new.3399 (New)


Package is "python-scales"

Tue Aug 18 15:08:13 2020 rev:3 rq:826844 version:1.0.9

Changes:

--- /work/SRC/openSUSE:Factory/python-scales/python-scales.changes  
2019-09-11 10:40:16.531221313 +0200
+++ /work/SRC/openSUSE:Factory/.python-scales.new.3399/python-scales.changes
2020-08-18 15:08:20.211973295 +0200
@@ -1,0 +2,10 @@
+Sat Aug 15 14:51:43 UTC 2020 - Matej Cepl 
+
+- Add clean_testsuite.patch (gh#Cue/scales#50).
+
+---
+Sat Aug 15 09:22:03 UTC 2020 - John Vandenberg 
+
+- Replace nose with pytest
+
+---

New:

  clean_testsuite.patch



Other differences:
--
++ python-scales.spec ++
--- /var/tmp/diff_new_pack.GjqsJO/_old  2020-08-18 15:08:21.051973642 +0200
+++ /var/tmp/diff_new_pack.GjqsJO/_new  2020-08-18 15:08:21.055973644 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-scales
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 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,10 @@
 Source: 
https://files.pythonhosted.org/packages/source/s/scales/scales-%{version}.tar.gz
 Source99:   https://raw.githubusercontent.com/Cue/scales/master/LICENSE
 Patch0: python38.patch
-BuildRequires:  %{python_module nose}
+# PATCH-FEATURE-UPSTREAM clean_testsuite.patch gh#Cue/scales#50 mc...@suse.com
+# clean up test suite
+Patch1: clean_testsuite.patch
+BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module six}
 BuildRequires:  fdupes
@@ -41,8 +44,10 @@
 
 %prep
 %setup -q -n scales-%{version}
-%patch0 -p1
+%autopatch -p1
+
 cp %{SOURCE99} .
+sed -i '/nose/d' setup.py
 
 %build
 %python_build
@@ -52,7 +57,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-%python_exec setup.py test
+%pytest
 
 %files %{python_files}
 %license LICENSE

++ clean_testsuite.patch ++
--- a/src/greplin/scales/aggregation_test.py
+++ b/src/greplin/scales/aggregation_test.py
@@ -45,8 +45,8 @@ class AggregationTest(unittest.TestCase)
 }})
 agg.addSource('source1', {'a': {'200': 10, '302': 10, '404': 1, '500': 3}})
 result = agg.result()
-self.assertEquals(result['a']['success']['sum'], 20)
-self.assertEquals(result['a']['error']['sum'], 4)
+self.assertEqual(result['a']['success']['sum'], 20)
+self.assertEqual(result['a']['error']['sum'], 4)
 
 
 
--- a/src/greplin/scales/formats_test.py
+++ b/src/greplin/scales/formats_test.py
@@ -64,7 +64,7 @@ class StatsTest(unittest.TestCase):
 out = six.StringIO()
 formats.jsonFormat(out)
 
-self.assertEquals('{"here": {"count": 1}}\n', out.getvalue())
+self.assertEqual('{"here": {"count": 1}}\n', out.getvalue())
 
 
 
@@ -91,7 +91,7 @@ class UnicodeFormatTest(unittest.TestCas
 out = six.StringIO()
 stats = {'name': self.UNICODE_VALUE}
 formats.jsonFormat(out, statDict=stats)
-self.assertEquals(stats, json.loads(out.getvalue()))
+self.assertEqual(stats, json.loads(out.getvalue()))
 
 
   def testJsonFormatBinaryGarbage(self):
@@ -99,6 +99,6 @@ class UnicodeFormatTest(unittest.TestCas
 out = six.StringIO()
 stats = {'garbage': '\xc2\xc2 ROAR!! \0\0'}
 formats.jsonFormat(out, statDict=stats)
-self.assertEquals(json.loads(out.getvalue()), {'garbage': six.u('\xc2\xc2 
ROAR!! \0\0')})
+self.assertEqual(json.loads(out.getvalue()), {'garbage': six.u('\xc2\xc2 
ROAR!! \0\0')})
 
 
--- a/src/greplin/scales/scales_test.py
+++ b/src/greplin/scales/scales_test.py
@@ -130,7 +130,7 @@ class StatsTest(unittest.TestCase):
 c = b.getChild(TypedChild)
 c.countStat += 2
 
-self.assertEquals({
+self.assertEqual({
   'path': {
 'to': {
   'A': {
@@ -159,7 +159,7 @@ class StatsTest(unittest.TestCase):
 c = b.getChild(Child)
 c.countStat += 2
 
-self.assertEquals({
+self.assertEqual({
   'path': {
 'to': {
   'A': {
@@ -184,7 +184,7 @@ class StatsTest(unittest.TestCase):
 c = a.getChild(Child, 'sub/path')
 c.countStat += 1
 
-self.assertEquals({
+self.assertEqual({
   'path': {
 'to': {
   'A': {
@@ -213,7 +213,7 @@ class StatsTest(unittest.TestCase):
 """Helps test summed stats."""
 c = a.getChild(Child)
 

commit python-scales for openSUSE:Factory

2019-09-11 Thread root
Hello community,

here is the log from the commit of package python-scales for openSUSE:Factory 
checked in at 2019-09-11 10:40:15

Comparing /work/SRC/openSUSE:Factory/python-scales (Old)
 and  /work/SRC/openSUSE:Factory/.python-scales.new.7948 (New)


Package is "python-scales"

Wed Sep 11 10:40:15 2019 rev:2 rq:729907 version:1.0.9

Changes:

--- /work/SRC/openSUSE:Factory/python-scales/python-scales.changes  
2018-09-18 11:51:31.375408900 +0200
+++ /work/SRC/openSUSE:Factory/.python-scales.new.7948/python-scales.changes
2019-09-11 10:40:16.531221313 +0200
@@ -1,0 +2,6 @@
+Tue Sep 10 13:59:35 UTC 2019 - Tomáš Chvátal 
+
+- Add patch to work with python 3.8:
+  * python38.patch
+
+---

New:

  python38.patch



Other differences:
--
++ python-scales.spec ++
--- /var/tmp/diff_new_pack.S2QyXK/_old  2019-09-11 10:40:18.255221006 +0200
+++ /var/tmp/diff_new_pack.S2QyXK/_new  2019-09-11 10:40:18.259221005 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-scales
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -26,6 +26,7 @@
 URL:https://www.github.com/Cue/scales
 Source: 
https://files.pythonhosted.org/packages/source/s/scales/scales-%{version}.tar.gz
 Source99:   https://raw.githubusercontent.com/Cue/scales/master/LICENSE
+Patch0: python38.patch
 BuildRequires:  %{python_module nose}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module six}
@@ -40,6 +41,7 @@
 
 %prep
 %setup -q -n scales-%{version}
+%patch0 -p1
 cp %{SOURCE99} .
 
 %build

++ python38.patch ++
>From ee69d45f1a7f928f7b241702e9be06007444115e Mon Sep 17 00:00:00 2001
From: Lumir Balhar 
Date: Fri, 30 Aug 2019 10:59:43 +0200
Subject: [PATCH 2/2] Use `html` module in Python 3 and cgi module in Python 2

`cgi.escape()` has been deprecated since Python 3.2 and
removed from Python 3.8.

Fixes: https://github.com/Cue/scales/issues/46
---
 src/greplin/scales/formats.py | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/greplin/scales/formats.py b/src/greplin/scales/formats.py
index c4ef979..b6a96d4 100644
--- a/src/greplin/scales/formats.py
+++ b/src/greplin/scales/formats.py
@@ -16,7 +16,11 @@
 
 from greplin import scales
 
-import cgi
+try:
+  import html
+except ImportError:
+  # Python 2.7 has no html module
+  import cgi as html
 import six
 import json
 import operator
@@ -105,7 +109,7 @@ def _htmlRenderDict(pathParts, statDict, output):
 
   output.write('')
   for key in keys:
-keyStr = cgi.escape(_utf8str(key))
+keyStr = html.escape(_utf8str(key))
 value = statDict[key]
 if hasattr(value, '__call__'):
   value = value()
@@ -119,7 +123,7 @@ def _htmlRenderDict(pathParts, statDict, output):
 _htmlRenderDict(valuePath, value, output)
 else:
   output.write('%s %s' %
-   (keyStr, type(value).__name__, 
cgi.escape(_utf8str(value)).replace('\n', '')))
+   (keyStr, type(value).__name__, 
html.escape(_utf8str(value)).replace('\n', '')))
 
   if links:
 for link in links: