Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pyperf for openSUSE:Factory checked in at 2022-11-12 17:40:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyperf (Old) and /work/SRC/openSUSE:Factory/.python-pyperf.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyperf" Sat Nov 12 17:40:53 2022 rev:7 rq:1035239 version:2.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyperf/python-pyperf.changes 2022-10-08 01:25:12.530227432 +0200 +++ /work/SRC/openSUSE:Factory/.python-pyperf.new.1597/python-pyperf.changes 2022-11-12 17:41:09.718165425 +0100 @@ -1,0 +2,8 @@ +Wed Nov 9 18:34:02 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to version 2.5.0 + * Recognize new name of Graal-based Python as jitted by @timfel in #139 + * Collect specialization statistics from running benchmarks by @mdboom in #140 + * Add support for Python 3.11 by @hugovk in #142 + +------------------------------------------------------------------- Old: ---- pyperf-2.4.1.tar.gz New: ---- pyperf-2.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyperf.spec ++++++ --- /var/tmp/diff_new_pack.MCj9pm/_old 2022-11-12 17:41:10.154168021 +0100 +++ /var/tmp/diff_new_pack.MCj9pm/_new 2022-11-12 17:41:10.158168045 +0100 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-pyperf -Version: 2.4.1 +Version: 2.5.0 Release: 0 Summary: Python module to run and analyze benchmarks License: MIT ++++++ pyperf-2.4.1.tar.gz -> pyperf-2.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/PKG-INFO new/pyperf-2.5.0/PKG-INFO --- old/pyperf-2.4.1/PKG-INFO 2022-08-06 17:46:21.103185700 +0200 +++ new/pyperf-2.5.0/PKG-INFO 2022-11-04 15:25:21.172275500 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyperf -Version: 2.4.1 +Version: 2.5.0 Summary: Python module to run and analyze benchmarks Home-page: https://github.com/psf/pyperf Author: Victor Stinner @@ -145,7 +145,7 @@ python3 -m pip install pyperf -pyperf requires Python 3.6 or newer. +pyperf requires Python 3.7 or newer. Python 2.7 users can use pyperf 1.7.1 which is the last version compatible with Python 2.7. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/README.rst new/pyperf-2.5.0/README.rst --- old/pyperf-2.4.1/README.rst 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/README.rst 2022-11-04 15:25:18.000000000 +0100 @@ -128,7 +128,7 @@ python3 -m pip install pyperf -pyperf requires Python 3.6 or newer. +pyperf requires Python 3.7 or newer. Python 2.7 users can use pyperf 1.7.1 which is the last version compatible with Python 2.7. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/doc/changelog.rst new/pyperf-2.5.0/doc/changelog.rst --- old/pyperf-2.4.1/doc/changelog.rst 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/doc/changelog.rst 2022-11-04 15:25:18.000000000 +0100 @@ -1,6 +1,15 @@ Changelog ========= +Version 2.5.0 (2022-11-04) +------------- + +* Support collecting specialization statistics from running benchmarks. + Patch by Mike Droettboom. + +* Recognize new name of Graal-based Python as jitted. + Patch by Michael Droettboom + Version 2.4.1 (2022-08-07) ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/doc/conf.py new/pyperf-2.5.0/doc/conf.py --- old/pyperf-2.4.1/doc/conf.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/doc/conf.py 2022-11-04 15:25:18.000000000 +0100 @@ -55,7 +55,7 @@ # built documents. # # The short X.Y version. -version = release = '2.4.1' +version = release = '2.5.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/doc/run_benchmark.rst new/pyperf-2.5.0/doc/run_benchmark.rst --- old/pyperf-2.4.1/doc/run_benchmark.rst 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/doc/run_benchmark.rst 2022-11-04 15:25:18.000000000 +0100 @@ -191,4 +191,16 @@ the benchmark less reliable since two runs may use a different number of warmup values. +Specializer statistics (``pystats``) +================================== +``pyperf`` has built-in support for `specializer statistics (``pystats``) <https://docs.python.org/dev/using/configure.html#cmdoption-enable-pystats>`_. +If running benchmarks on a CPython built with the ``--enable-pystats`` flag, pyperf will automatically collect ``pystats`` on the benchmark code by calling ``sys._stats_on`` immediately before the benchmark and calling ``sys._stats_off`` immediately after. +Stats are not collected when running ``pyperf``'s own code or when warming up or calibrating the benchmarks. + +Due to the overhead of collecting the statistics, the timing results will be meaningless. + +The `Tools/scripts/summarize_stats.py <https://github.com/python/cpython/blob/main/Tools/scripts/summarize_stats.py>`_ script can be used to summarize the statistics in a human-readable form. + +Statistics are not cleared between runs. +If you need to delete statistics from a previous run, remove the files in ``/tmp/py_stats`` (Unix) or ``C:\temp\py_stats`` (Windows). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/__init__.py new/pyperf-2.5.0/pyperf/__init__.py --- old/pyperf-2.4.1/pyperf/__init__.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/__init__.py 2022-11-04 15:25:18.000000000 +0100 @@ -1,6 +1,6 @@ from time import perf_counter -VERSION = (2, 4, 1) +VERSION = (2, 5, 0) __version__ = '.'.join(map(str, VERSION)) # Export pyperf.perf_counter for backward compatibility with pyperf 1.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/__main__.py new/pyperf-2.5.0/pyperf/__main__.py --- old/pyperf-2.4.1/pyperf/__main__.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/__main__.py 2022-11-04 15:25:18.000000000 +0100 @@ -580,7 +580,7 @@ checks=checks): print(line) - if not(is_last or ignored): + if not (is_last or ignored): print() for suite, ignored in ignored: @@ -691,7 +691,7 @@ for benchmark in suite: benchmark._remove_all_metadata() - compact = not(args.indent) + compact = not args.indent if args.output_filename: suite.dump(args.output_filename, compact=compact) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/_bench.py new/pyperf-2.5.0/pyperf/_bench.py --- old/pyperf-2.4.1/pyperf/_bench.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/_bench.py 2022-11-04 15:25:18.000000000 +0100 @@ -93,7 +93,7 @@ def __init__(self, values, warmups=None, metadata=None, collect_metadata=True): - if any(not(isinstance(value, NUMBER_TYPES) and value > 0) + if any(not (isinstance(value, NUMBER_TYPES) and value > 0) for value in values): raise ValueError("values must be a sequence of number > 0.0") @@ -425,7 +425,7 @@ return value def percentile(self, p): - if not(0 <= p <= 100): + if not (0 <= p <= 100): raise ValueError("p must be in the range [0; 100]") return percentile(self.get_values(), p / 100.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/_cli.py new/pyperf-2.5.0/pyperf/_cli.py --- old/pyperf-2.4.1/pyperf/_cli.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/_cli.py 2022-11-04 15:25:18.000000000 +0100 @@ -255,7 +255,7 @@ else: text = "%s (average)" % total_loops - if not(isinstance(inner_loops, int) and inner_loops == 1): + if not (isinstance(inner_loops, int) and inner_loops == 1): if isinstance(loops, int): loops = format_number(loops, 'outer-loop') else: @@ -324,7 +324,7 @@ iqr = q3 - q1 outlier_min = (q1 - 1.5 * iqr) outlier_max = (q3 + 1.5 * iqr) - noutlier = sum(not(outlier_min <= value <= outlier_max) + noutlier = sum(not (outlier_min <= value <= outlier_max) for value in values) bounds = bench.format_values((outlier_min, outlier_max)) lines.append('Number of outlier (out of %s..%s): %s' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/_collect_metadata.py new/pyperf-2.5.0/pyperf/_collect_metadata.py --- old/pyperf-2.4.1/pyperf/_collect_metadata.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/_collect_metadata.py 2022-11-04 15:25:18.000000000 +0100 @@ -116,6 +116,10 @@ if not gc.isenabled(): metadata['python_gc'] = 'disabled' + # pystats enabled? + if hasattr(sys, "_stats_clear"): + metadata['pystats'] = 'enabled' + def read_proc(path): path = proc_path(path) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/_compare.py new/pyperf-2.5.0/pyperf/_compare.py --- old/pyperf-2.4.1/pyperf/_compare.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/_compare.py 2022-11-04 15:25:18.000000000 +0100 @@ -395,7 +395,7 @@ for result in results: lines.extend(result.format(self.verbose)) - if not(significant or self.verbose): + if not (significant or self.verbose): not_significant.append(results.name) continue @@ -472,7 +472,7 @@ ] self.compare_suites(all_results) print() - display_title(f"All benchmarks:") + display_title("All benchmarks:") self.compare_suites(self.all_results) if not self.quiet: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/_manager.py new/pyperf-2.5.0/pyperf/_manager.py --- old/pyperf-2.4.1/pyperf/_manager.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/_manager.py 2022-11-04 15:25:18.000000000 +0100 @@ -92,7 +92,7 @@ # bInheritHandles=True. For pass_handles, see # http://bugs.python.org/issue19764 kw['close_fds'] = False - elif sys.version_info >= (3, 2): + else: kw['pass_fds'] = [wpipe.fd] proc = subprocess.Popen(cmd, env=env, **kw) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/_runner.py new/pyperf-2.5.0/pyperf/_runner.py --- old/pyperf-2.4.1/pyperf/_runner.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/_runner.py 2022-11-04 15:25:18.000000000 +0100 @@ -77,6 +77,13 @@ program_args=None, add_cmdline_args=None, _argparser=None): + # Reset the stats collection if running a --enable-pystats build + try: + sys._stats_off() + sys._stats_clear() + except AttributeError: + pass + # Watchdog: ensure that only once instance of Runner (or a Runner # subclass) is created per process to prevent bad suprises cls = self.__class__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/_utils.py new/pyperf-2.5.0/pyperf/_utils.py --- old/pyperf-2.4.1/pyperf/_utils.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/_utils.py 2022-11-04 15:25:18.000000000 +0100 @@ -205,7 +205,7 @@ implementation_name = python_implementation() if implementation_name == 'pypy': return sys.pypy_translation_info["translation.jit"] - elif implementation_name == 'graalpython': + elif implementation_name in ['graalpython', 'graalpy']: return True elif hasattr(sys, "pyston_version_info") or "pyston_lite" in sys.modules: return True @@ -371,7 +371,7 @@ def percentile(values, p): - if not isinstance(p, float) or not(0.0 <= p <= 1.0): + if not isinstance(p, float) or not (0.0 <= p <= 1.0): raise ValueError("p must be a float in the range [0.0; 1.0]") values = sorted(values) @@ -427,4 +427,3 @@ dst_stats.dump_stats(dst) else: profiler.dump_stats(dst) - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/_worker.py new/pyperf-2.5.0/pyperf/_worker.py --- old/pyperf-2.4.1/pyperf/_worker.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/_worker.py 2022-11-04 15:25:18.000000000 +0100 @@ -56,6 +56,22 @@ else: value_name = 'Value' + task_func = self.task_func + + # If we are on a pystats build, turn on stats collection around the + # actual work, but only if we aren't warming up or calibrating. + if hasattr(sys, "_stats_on") and not is_warmup and not calibrate_loops: + core_task_func = task_func + + def stats_func(*args): + sys._stats_on() + try: + return core_task_func(*args) + finally: + sys._stats_off() + + task_func = stats_func + index = 1 inner_loops = self.inner_loops if not inner_loops: @@ -64,7 +80,7 @@ if index > nvalue: break - raw_value = self.task_func(self, self.loops) + raw_value = task_func(self, self.loops) raw_value = float(raw_value) value = raw_value / (self.loops * inner_loops) @@ -117,7 +133,7 @@ iqr = q3 - q1 outlier_max = (q3 + 1.5 * iqr) # only check maximum, not minimum - outlier = not(first_value <= outlier_max) + outlier = not (first_value <= outlier_max) mean1 = statistics.mean(sample1) mean2 = statistics.mean(sample2) @@ -169,7 +185,7 @@ if outlier: return False - if not(-0.5 <= mean_diff <= 0.10): + if not (-0.5 <= mean_diff <= 0.10): return False if abs(mad_diff) > 0.10: return False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/tests/__init__.py new/pyperf-2.5.0/pyperf/tests/__init__.py --- old/pyperf-2.4.1/pyperf/tests/__init__.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/tests/__init__.py 2022-11-04 15:25:18.000000000 +0100 @@ -15,10 +15,7 @@ def _capture_stream(name): old_stream = getattr(sys, name) try: - if sys.version_info >= (3,): - stream = io.StringIO() - else: - stream = io.BytesIO() + stream = io.StringIO() setattr(sys, name, stream) yield stream finally: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/tests/test_perf_cli.py new/pyperf-2.5.0/pyperf/tests/test_perf_cli.py --- old/pyperf-2.4.1/pyperf/tests/test_perf_cli.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/tests/test_perf_cli.py 2022-11-04 15:25:18.000000000 +0100 @@ -154,7 +154,6 @@ self.assertEqual(stdout.rstrip(), expected) - def test_compare_to_md_table(self): ref_result = self.create_bench((1.0,), metadata={'name': 'telco'}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf/tests/test_runner.py new/pyperf-2.5.0/pyperf/tests/test_runner.py --- old/pyperf-2.4.1/pyperf/tests/test_runner.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/pyperf/tests/test_runner.py 2022-11-04 15:25:18.000000000 +0100 @@ -74,6 +74,7 @@ self.assertEqual(bench.get_nrun(), 1) return Result(runner, bench, stdout) + def test_worker(self): result = self.exec_runner('--worker', '-l1', '-w1') self.assertRegex(result.stdout, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf.egg-info/PKG-INFO new/pyperf-2.5.0/pyperf.egg-info/PKG-INFO --- old/pyperf-2.4.1/pyperf.egg-info/PKG-INFO 2022-08-06 17:46:21.000000000 +0200 +++ new/pyperf-2.5.0/pyperf.egg-info/PKG-INFO 2022-11-04 15:25:21.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyperf -Version: 2.4.1 +Version: 2.5.0 Summary: Python module to run and analyze benchmarks Home-page: https://github.com/psf/pyperf Author: Victor Stinner @@ -145,7 +145,7 @@ python3 -m pip install pyperf -pyperf requires Python 3.6 or newer. +pyperf requires Python 3.7 or newer. Python 2.7 users can use pyperf 1.7.1 which is the last version compatible with Python 2.7. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf.egg-info/SOURCES.txt new/pyperf-2.5.0/pyperf.egg-info/SOURCES.txt --- old/pyperf-2.4.1/pyperf.egg-info/SOURCES.txt 2022-08-06 17:46:21.000000000 +0200 +++ new/pyperf-2.5.0/pyperf.egg-info/SOURCES.txt 2022-11-04 15:25:21.000000000 +0100 @@ -2,7 +2,6 @@ MANIFEST.in README.rst TODO.rst -setup.cfg setup.py test-requirements.txt tox.ini @@ -58,7 +57,6 @@ pyperf.egg-info/SOURCES.txt pyperf.egg-info/dependency_links.txt pyperf.egg-info/entry_points.txt -pyperf.egg-info/requires.txt pyperf.egg-info/top_level.txt pyperf/tests/__init__.py pyperf/tests/mult_list_bench.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/pyperf.egg-info/requires.txt new/pyperf-2.5.0/pyperf.egg-info/requires.txt --- old/pyperf-2.4.1/pyperf.egg-info/requires.txt 2022-08-06 17:46:21.000000000 +0200 +++ new/pyperf-2.5.0/pyperf.egg-info/requires.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ - -[:python_version < '3.4'] -statistics diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/setup.cfg new/pyperf-2.5.0/setup.cfg --- old/pyperf-2.4.1/setup.cfg 2022-08-06 17:46:21.103185700 +0200 +++ new/pyperf-2.5.0/setup.cfg 2022-11-04 15:25:21.172275500 +0100 @@ -1,6 +1,3 @@ -[bdist_wheel] -universal = 1 - [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperf-2.4.1/setup.py new/pyperf-2.5.0/setup.py --- old/pyperf-2.4.1/setup.py 2022-08-06 17:46:18.000000000 +0200 +++ new/pyperf-2.5.0/setup.py 2022-11-04 15:25:18.000000000 +0100 @@ -13,7 +13,7 @@ # # Release a new version: # -# - go to the Github release tab: https://github.com/psf/pyperf/releases +# - go to the GitHub release tab: https://github.com/psf/pyperf/releases # - click "Draft a new release" and fill the contents # - finally click the "Publish release" button! Done! # - monitor the publish status: https://github.com/psf/pyperf/actions/workflows/publish.yml @@ -24,7 +24,7 @@ # - git commit -a -m "post-release" # - git push or send the PR to the repository -VERSION = '2.4.1' +VERSION = '2.5.0' DESCRIPTION = 'Python module to run and analyze benchmarks' CLASSIFIERS = [ @@ -39,7 +39,7 @@ # put most of the code inside main() to be able to import setup.py in -# test_tools.py, to ensure that VERSION is the same than +# test_tools.py, to ensure that VERSION is the same as # pyperf.__version__. def main(): from setuptools import setup @@ -61,9 +61,6 @@ 'install_requires': [], # don't use environment markers in install_requires, but use weird # syntax of extras_require, to support setuptools 18 - 'extras_require': { - ":python_version < '3.4'": ["statistics"], - }, 'entry_points': { 'console_scripts': ['pyperf=pyperf.__main__:main'] }