forked from pool/python-pyperf
- Add patches to work with py3.8:
* python-retcode.patch * python38.patch - 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. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyperf?expand=0&rev=3
This commit is contained in:
committed by
Git OBS Bridge
parent
eef4b1dded
commit
0d42012e1b
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:8d0143a22a13ee10c997a648f30b82cdc40175d5a20b11055ae058a82e45d371
|
|
||||||
size 174419
|
|
3
pyperf-1.7.0.tar.gz
Normal file
3
pyperf-1.7.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:0d214aa65e085d3e4108a36152cb12f7cd0f4e7fda93b5134b43a9687c975786
|
||||||
|
size 174678
|
@@ -1,3 +1,23 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 9 10:35:44 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
- Add patches to work with py3.8:
|
||||||
|
* python-retcode.patch
|
||||||
|
* python38.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 9 09:21:24 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
- 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 <jayvdb@gmail.com>
|
Sat Oct 12 16:36:04 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-pyperf
|
# 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
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# 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)
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
# published by the Open Source Initiative.
|
# 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-%{**}}
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
Name: python-pyperf
|
Name: python-pyperf
|
||||||
Version: 1.6.1
|
Version: 1.7.0
|
||||||
Release: 0
|
Release: 0
|
||||||
License: MIT
|
|
||||||
Summary: Python module to run and analyze benchmarks
|
Summary: Python module to run and analyze benchmarks
|
||||||
Url: https://github.com/vstinner/pyperf
|
License: MIT
|
||||||
Group: Development/Languages/Python
|
URL: https://github.com/vstinner/pyperf
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pyperf/pyperf-%{version}.tar.gz
|
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: %{python_module setuptools}
|
||||||
|
BuildRequires: fdupes
|
||||||
|
BuildRequires: python-rpm-macros
|
||||||
|
Requires: python-six
|
||||||
|
Recommends: python-psutil
|
||||||
|
BuildArch: noarch
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: %{python_module mock}
|
BuildRequires: %{python_module mock}
|
||||||
BuildRequires: %{python_module psutil}
|
BuildRequires: %{python_module psutil}
|
||||||
@@ -35,15 +41,10 @@ BuildRequires: python2-contextlib2
|
|||||||
BuildRequires: python2-statistics
|
BuildRequires: python2-statistics
|
||||||
BuildRequires: python2-unittest2
|
BuildRequires: python2-unittest2
|
||||||
# /SECTION
|
# /SECTION
|
||||||
BuildRequires: fdupes
|
|
||||||
Requires: python-six
|
|
||||||
Recommends: python-psutil
|
|
||||||
%ifpython2
|
%ifpython2
|
||||||
Requires: python2-contextlib2
|
Requires: python2-contextlib2
|
||||||
Requires: python2-statistics
|
Requires: python2-statistics
|
||||||
%endif
|
%endif
|
||||||
BuildArch: noarch
|
|
||||||
|
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -51,6 +52,7 @@ Python module to run and analyze benchmarks.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pyperf-%{version}
|
%setup -q -n pyperf-%{version}
|
||||||
|
%autopatch -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
@@ -60,8 +62,7 @@ Python module to run and analyze benchmarks.
|
|||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# See https://github.com/vstinner/pyperf/issues/58 for test_collect_metadata failure
|
%pytest
|
||||||
%pytest -k 'not test_collect_metadata'
|
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
|
15
python-retcode.patch
Normal file
15
python-retcode.patch
Normal file
@@ -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__":
|
14
python38.patch
Normal file
14
python38.patch
Normal file
@@ -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()'
|
Reference in New Issue
Block a user