diff --git a/pyperf-1.6.1.tar.gz b/pyperf-1.6.1.tar.gz deleted file mode 100644 index 2017403..0000000 --- a/pyperf-1.6.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8d0143a22a13ee10c997a648f30b82cdc40175d5a20b11055ae058a82e45d371 -size 174419 diff --git a/pyperf-1.7.0.tar.gz b/pyperf-1.7.0.tar.gz new file mode 100644 index 0000000..aa511af --- /dev/null +++ b/pyperf-1.7.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d214aa65e085d3e4108a36152cb12f7cd0f4e7fda93b5134b43a9687c975786 +size 174678 diff --git a/python-pyperf.changes b/python-pyperf.changes index 1728961..fc20c3c 100644 --- a/python-pyperf.changes +++ b/python-pyperf.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Mon Mar 9 10:35:44 UTC 2020 - Tomáš Chvátal + +- Add patches to work with py3.8: + * python-retcode.patch + * python38.patch + +------------------------------------------------------------------- +Mon Mar 9 09:21:24 UTC 2020 - Tomáš Chvátal + +- Update to 1.7.0: + * metadata: add ``python_compiler`` + * Windows: inherit ``SystemDrive`` environment variable by default. + * Fix tests on ARM and PPC: cpu_model_name metadata is no longer required + on Linux. + * tests: Do not allow test suite to execute without unittest2 on Python2, + otherwise man failures occur due to missing 'assertRegex'. + * doc: Update old/dead links. + * Travis CI: drop Python 3.4 support. + ------------------------------------------------------------------- Sat Oct 12 16:36:04 UTC 2019 - John Vandenberg diff --git a/python-pyperf.spec b/python-pyperf.spec index c1820cf..fada720 100644 --- a/python-pyperf.spec +++ b/python-pyperf.spec @@ -1,7 +1,7 @@ # # spec file for package python-pyperf # -# 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 @@ -12,20 +12,26 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pyperf -Version: 1.6.1 +Version: 1.7.0 Release: 0 -License: MIT Summary: Python module to run and analyze benchmarks -Url: https://github.com/vstinner/pyperf -Group: Development/Languages/Python +License: MIT +URL: https://github.com/vstinner/pyperf Source: https://files.pythonhosted.org/packages/source/p/pyperf/pyperf-%{version}.tar.gz -BuildRequires: python-rpm-macros +Patch0: python38.patch +Patch1: python-retcode.patch BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-six +Recommends: python-psutil +BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module mock} BuildRequires: %{python_module psutil} @@ -35,15 +41,10 @@ BuildRequires: python2-contextlib2 BuildRequires: python2-statistics BuildRequires: python2-unittest2 # /SECTION -BuildRequires: fdupes -Requires: python-six -Recommends: python-psutil %ifpython2 Requires: python2-contextlib2 Requires: python2-statistics %endif -BuildArch: noarch - %python_subpackages %description @@ -51,6 +52,7 @@ Python module to run and analyze benchmarks. %prep %setup -q -n pyperf-%{version} +%autopatch -p1 %build %python_build @@ -60,8 +62,7 @@ Python module to run and analyze benchmarks. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -# See https://github.com/vstinner/pyperf/issues/58 for test_collect_metadata failure -%pytest -k 'not test_collect_metadata' +%pytest %files %{python_files} %doc README.rst diff --git a/python-retcode.patch b/python-retcode.patch new file mode 100644 index 0000000..5d8f6cd --- /dev/null +++ b/python-retcode.patch @@ -0,0 +1,15 @@ +Index: pyperf-1.7.0/pyperf/tests/test_system.py +=================================================================== +--- pyperf-1.7.0.orig/pyperf/tests/test_system.py ++++ pyperf-1.7.0/pyperf/tests/test_system.py +@@ -18,7 +18,9 @@ class SystemTests(unittest.TestCase): + + # The return code is either 0 if the system is tuned or 2 if the + # system isn't +- self.assertIn(proc.returncode, (0, 2), msg=proc) ++ # Also it can return 1 if /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ++ # is not available ++ self.assertIn(proc.returncode, (0, 1, 2), msg=proc) + + + if __name__ == "__main__": diff --git a/python38.patch b/python38.patch new file mode 100644 index 0000000..d09525b --- /dev/null +++ b/python38.patch @@ -0,0 +1,14 @@ +Index: pyperf-1.7.0/pyperf/_collect_metadata.py +=================================================================== +--- pyperf-1.7.0.orig/pyperf/_collect_metadata.py ++++ pyperf-1.7.0/pyperf/_collect_metadata.py +@@ -92,7 +92,8 @@ def collect_python_metadata(metadata): + metadata['timer'] = ('%s, resolution: %s' + % (info.implementation, + format_timedelta(info.resolution))) +- elif pyperf.perf_counter == time.clock: ++ elif (hasattr(time, 'clock') ++ and pyperf.perf_counter == time.clock): + metadata['timer'] = 'time.clock()' + elif pyperf.perf_counter == time.time: + metadata['timer'] = 'time.time()'