Hello community, here is the log from the commit of package python-nose-timer for openSUSE:Leap:15.2 checked in at 2020-04-08 12:48:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/python-nose-timer (Old) and /work/SRC/openSUSE:Leap:15.2/.python-nose-timer.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-nose-timer" Wed Apr 8 12:48:28 2020 rev:5 rq:790217 version:1.0.0 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/python-nose-timer/python-nose-timer.changes 2020-03-09 18:09:23.197026382 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.python-nose-timer.new.3248/python-nose-timer.changes 2020-04-08 12:49:08.102365740 +0200 @@ -1,0 +2,17 @@ +Mon Mar 30 10:32:33 UTC 2020 - [email protected] + +- version update to 1.0.0 + * Fix example installation call for pip. (#259) + * Allow colorlog 4. (#257) + * Order Pythons in descending version in appveyor.yml. (#258) + * Add link to GitHub Action for Nox. (#255) + * Use double "`" for inline code. (#254) + * Add types to _option_set.py. (#249) + * Add type hints to tasks.py. (#241) + * Fix typo (virtulenvs). (#247) + * Replace flake8 sorter with isort. (#242) + * Pass VIRTUAL_ENV environment variable to commands executed in a virtualenv. (#245) + * Fix docs to show correct list for parametrize. (#244) + * Add argcomplete dependency to conda test session. (#240) + +------------------------------------------------------------------- Old: ---- v0.7.5.tar.gz New: ---- v1.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-nose-timer.spec ++++++ --- /var/tmp/diff_new_pack.H3VBT6/_old 2020-04-08 12:49:08.938366176 +0200 +++ /var/tmp/diff_new_pack.H3VBT6/_new 2020-04-08 12:49:08.942366178 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-nose-timer # -# 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 @@ -18,23 +18,24 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-nose-timer -Version: 0.7.5 +Version: 1.0.0 Release: 0 Summary: A timer plugin for nosetests License: MIT Group: Development/Languages/Python URL: https://github.com/mahmoudimus/nose-timer Source: https://github.com/mahmoudimus/nose-timer/archive/v%{version}.tar.gz -BuildRequires: %{python_module mock} BuildRequires: %{python_module nose} -BuildRequires: %{python_module parameterized} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-nose BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module nose} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module parameterized} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module termcolor} # /SECTION %python_subpackages @@ -54,7 +55,7 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_expand nosetests-%$python_bin_suffix +%pytest %files %{python_files} %doc README.rst ++++++ v0.7.5.tar.gz -> v1.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nose-timer-0.7.5/.travis.yml new/nose-timer-1.0.0/.travis.yml --- old/nose-timer-0.7.5/.travis.yml 2019-03-14 05:50:21.000000000 +0100 +++ new/nose-timer-1.0.0/.travis.yml 2020-03-17 07:11:59.000000000 +0100 @@ -1,24 +1,18 @@ language: python matrix: include: - - python: 2.7 - env: TOXENV=pep8 - - python: pypy - env: TOXENV=pypy - - python: pypy3 - env: TOXENV=pypy3 - - python: 2.7 - env: TOXENV=py27 - - python: 3.4 - env: TOXENV=py34 - python: 3.5 env: TOXENV=py35 - python: 3.6 env: TOXENV=py36 - python: 3.7 env: TOXENV=py37 - dist: xenial - sudo: true + - python: 3.8 + env: TOXENV=py38 + - python: pypy + env: TOXENV=pypy + - python: pypy3 + env: TOXENV=pypy3 install: - pip install tox - pip install mock @@ -30,6 +24,6 @@ password: secure: OhjlsFN3zIHqW6PlpSanlHhJ3Bx6jIAPZM6jObMeA4yXp74NCdzpPBS/Drdj0dnKXj5edkzUQ4iC72Eyx5vmHvq0yHIM49FvfEliJ5oihQGgqZufqA6EjaVSvRaRh7ZERcwGKzbPpCGulh55V1bURDFOTXwk2n9X4/xmIyX3v7w= on: - python: 3.7 + python: 3.8 tags: true repo: mahmoudimus/nose-timer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nose-timer-0.7.5/LICENSE new/nose-timer-1.0.0/LICENSE --- old/nose-timer-0.7.5/LICENSE 2019-03-14 05:50:21.000000000 +0100 +++ new/nose-timer-1.0.0/LICENSE 2020-03-17 07:11:59.000000000 +0100 @@ -1,15 +1,21 @@ -Copyright (c) 2013 Mahmoud Abdelkader. -All rights reserved. - MIT License -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Copyright (c) 2013-2019 Mahmoud Abdelkader + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nose-timer-0.7.5/nosetimer/__init__.py new/nose-timer-1.0.0/nosetimer/__init__.py --- old/nose-timer-0.7.5/nosetimer/__init__.py 2019-03-14 05:50:21.000000000 +0100 +++ new/nose-timer-1.0.0/nosetimer/__init__.py 2020-03-17 07:11:59.000000000 +0100 @@ -1 +1 @@ -__version__ = '0.7.5' +__version__ = '1.0.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nose-timer-0.7.5/nosetimer/plugin.py new/nose-timer-1.0.0/nosetimer/plugin.py --- old/nose-timer-0.7.5/nosetimer/plugin.py 2019-03-14 05:50:21.000000000 +0100 +++ new/nose-timer-1.0.0/nosetimer/plugin.py 2020-03-17 07:11:59.000000000 +0100 @@ -16,7 +16,7 @@ try: import termcolor except ImportError: - termcolor = None + termcolor = None # noqa try: import colorama @@ -102,6 +102,12 @@ time_format = re.compile(r'^(?P<time>\d+)(?P<units>s|ms)?$') _timed_tests = {} + _COLOR_TO_FILTER = { + 'green': 'ok', + 'yellow': 'warning', + 'red': 'error', + } + def __init__(self, *args, **kwargs): super(TimerPlugin, self).__init__(*args, **kwargs) self._threshold = None @@ -121,15 +127,13 @@ Raises the ``ValueError`` for invalid format. """ try: - # Default time unit is a second, we should convert it to - # milliseconds. + # Default time unit is a second, we should convert it to milliseconds. return int(value) * 1000 except ValueError: # Try to parse if we are unlucky to cast value into int. m = self.time_format.match(value) if not m: - raise ValueError("Could not parse time represented by " - "'{t}'".format(t=value)) + raise ValueError("Could not parse time represented by '{t}'".format(t=value)) time = int(m.group('time')) if m.group('units') != 'ms': time *= 1000 @@ -158,9 +162,7 @@ self.timer_no_color = options.timer_no_color # determine if multiprocessing plugin enabled - self.multiprocessing_enabled = ( - bool(getattr(options, 'multiprocess_workers', False)) - ) + self.multiprocessing_enabled = bool(getattr(options, 'multiprocess_workers', False)) def startTest(self, test): """Initializes a timer before starting a test.""" @@ -183,9 +185,7 @@ except Queue.Empty: pass - d = sorted(self._timed_tests.items(), - key=lambda item: item[1]['time'], - reverse=True) + d = sorted(self._timed_tests.items(), key=lambda item: item[1]['time'], reverse=True) if self.json_file: dict_type = OrderedDict if self.timer_top_n else dict @@ -199,25 +199,18 @@ status = time_and_status['status'] if i < self.timer_top_n or self.timer_top_n == -1: color = self._get_result_color(time_taken) - percent = 0 if total_time == 0 else time_taken/total_time*100 - line = self._format_report_line(test, - time_taken, - color, - status, - percent) - _filter = self._color_to_filter(color) - if (self.timer_filter is None or _filter is None or - _filter in self.timer_filter): + percent = 0 if total_time == 0 else time_taken / total_time * 100 + line = self._format_report_line( + test=test, + time_taken=time_taken, + color=color, + status=status, + percent=percent, + ) + _filter = self._COLOR_TO_FILTER.get(color) + if self.timer_filter is None or _filter is None or _filter in self.timer_filter: stream.writeln(line) - def _color_to_filter(self, color): - """Get filter name by a given color.""" - return { - 'green': 'ok', - 'yellow': 'warning', - 'red': 'error', - }.get(color) - def _get_result_color(self, time_taken): """Get time taken result color.""" time_taken_ms = time_taken * 1000 @@ -275,8 +268,7 @@ def addSuccess(self, test, capt=None): """Called when a test passes.""" time_taken = self._register_time(test, 'success') - if self.timer_fail is not None and \ - time_taken * 1000.0 > self.threshold: + if self.timer_fail is not None and time_taken * 1000.0 > self.threshold: test.fail('Test was too slow (took {0:0.4f}s, threshold was ' '{1:0.4f}s)'.format(time_taken, self.threshold / 1000.0)) @@ -289,8 +281,7 @@ time_taken = self._timed_tests.get(test.id())['time'] if time_taken is not None: color = self._get_result_color(time_taken) - output += ' ({0})'.format(self._colored_time(time_taken, - color)) + output += ' ({0})'.format(self._colored_time(time_taken, color)) result.stream.writeln(output) elif result.dots: result.stream.write('.') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nose-timer-0.7.5/requirements.txt new/nose-timer-1.0.0/requirements.txt --- old/nose-timer-0.7.5/requirements.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/nose-timer-1.0.0/requirements.txt 2020-03-17 07:11:59.000000000 +0100 @@ -0,0 +1 @@ +nose diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nose-timer-0.7.5/setup.py new/nose-timer-1.0.0/setup.py --- old/nose-timer-0.7.5/setup.py 2019-03-14 05:50:21.000000000 +0100 +++ new/nose-timer-1.0.0/setup.py 2020-03-17 07:11:59.000000000 +0100 @@ -32,7 +32,9 @@ 'Stanislav Kudriashev', ]), url='https://github.com/mahmoudimus/nose-timer', - packages=['nosetimer', ], + packages=[ + 'nosetimer', + ], install_requires=[ 'nose', ], @@ -40,24 +42,23 @@ entry_points={ 'nose.plugins.0.10': [ 'nosetimer = nosetimer.plugin:TimerPlugin', - ] + ], }, classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', + 'Programming Language :: Python', 'Topic :: Software Development :: Testing', - 'Environment :: Console', ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nose-timer-0.7.5/test-requirements.txt new/nose-timer-1.0.0/test-requirements.txt --- old/nose-timer-0.7.5/test-requirements.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/nose-timer-1.0.0/test-requirements.txt 2020-03-17 07:11:59.000000000 +0100 @@ -0,0 +1,4 @@ +coverage +mock +parameterized +termcolor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nose-timer-0.7.5/tests/test_plugin.py new/nose-timer-1.0.0/tests/test_plugin.py --- old/nose-timer-0.7.5/tests/test_plugin.py 2019-03-14 05:50:21.000000000 +0100 +++ new/nose-timer-1.0.0/tests/test_plugin.py 2020-03-17 07:11:59.000000000 +0100 @@ -20,6 +20,25 @@ self.test_mock.id.return_value = 1 self.opts_mock = mock.MagicMock(name='opts') + @parameterized.expand([ + (1.00, 'green'), + (1.01, 'yellow'), + (2.01, 'red'), + ]) + def test_get_result_color(self, time_taken, color): + self.assertEqual(self.plugin._get_result_color(time_taken=time_taken), color) + + @parameterized.expand([ + ('green', '\x1b[32m1.0000s\x1b[0m'), + ('yellow', '\x1b[33m1.0000s\x1b[0m'), + ('red', '\x1b[31m1.0000s\x1b[0m'), + ]) + def test_format_report_line(self, color, expected): + self.assertEqual( + self.plugin._format_report_line(self.test_mock, 1, color, 'error', 0.1), + "[error] 0.10%% %s: %s" % (self.test_mock, expected), + ) + def test_add_error(self): self.plugin.addError(self.test_mock, None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nose-timer-0.7.5/tox.ini new/nose-timer-1.0.0/tox.ini --- old/nose-timer-0.7.5/tox.ini 2019-03-14 05:50:21.000000000 +0100 +++ new/nose-timer-1.0.0/tox.ini 2020-03-17 07:11:59.000000000 +0100 @@ -1,5 +1,5 @@ [tox] -envlist = pep8,pypy,pypy3,py27,py34,py35,py36,py37 +envlist = pep8,py35,py36,py37,py38,pypy,pypy3 [testenv] usedevelop = True @@ -24,5 +24,6 @@ flake8 {posargs} [flake8] +max-line-length = 120 builtins = _ exclude = .venv,.tox,doc,*egg,.git
