Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-uproot for openSUSE:Factory checked in at 2022-03-09 18:47:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-uproot (Old) and /work/SRC/openSUSE:Factory/.python-uproot.new.2349 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-uproot" Wed Mar 9 18:47:42 2022 rev:6 rq:960302 version:4.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-uproot/python-uproot.changes 2022-02-15 23:58:16.924378488 +0100 +++ /work/SRC/openSUSE:Factory/.python-uproot.new.2349/python-uproot.changes 2022-03-11 11:34:20.474131784 +0100 @@ -1,0 +2,19 @@ +Tue Mar 8 21:05:49 UTC 2022 - Atri Bhattacharya <badshah...@gmail.com> + +- Update to version 4.2.1: + * Added a rule to skip parsing Float16/Double32 TBranch titles + if the title is not parsable (and just assume default number + of bits) [gh#scikit-hep/uproot4#561]. + * Removed references to deprecated distutils and Pandas + Int64Index [gh#scikit-hep/uproot4#564]. + * Removed the rule that interpreted fBits as 1 byte (it's 4 + bytes everywhere except in some branches of some Delphes + files) [gh#scikit-hep/uproot4#570]. +- Add uproot-use-packaging-module.patch -- Use packaging module + directly instead of calling it via setup.extern; the latter does + not work on openSUSE directly. +- Introduce Requires and BuildRequires (for tests) on + python-packaging in light of above patch. +- Update tests.tar.xz to tagged 4.2.1 version. + +------------------------------------------------------------------- Old: ---- uproot-4.2.0.tar.gz New: ---- uproot-4.2.1.tar.gz uproot-use-packaging-module.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-uproot.spec ++++++ --- /var/tmp/diff_new_pack.FH5poE/_old 2022-03-11 11:34:20.970132366 +0100 +++ /var/tmp/diff_new_pack.FH5poE/_new 2022-03-11 11:34:20.974132371 +0100 @@ -20,7 +20,7 @@ %define skip_python36 1 %global modname uproot Name: python-uproot -Version: 4.2.0 +Version: 4.2.1 Release: 0 Summary: ROOT I/O in pure Python and Numpy License: BSD-3-Clause @@ -28,11 +28,14 @@ URL: https://github.com/scikit-hep/uproot4 Source0: https://files.pythonhosted.org/packages/source/u/uproot/uproot-%{version}.tar.gz Source1: tests.tar.xz +# PATCH-FEATURE-OPENSUSE uproot-use-packaging-module.patch badshah...@gmail.com -- Use packaging module directly instead of calling it via setup.extern; the latter does not work on openSUSE directly +Patch0: uproot-use-packaging-module.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-numpy >= 1.13.1 +Requires: python-packaging Recommends: python-awkward Suggests: python-lz4 Suggests: python-zstandard @@ -47,6 +50,7 @@ BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module lz4} BuildRequires: %{python_module numpy >= 1.13.1} +BuildRequires: %{python_module packaging} BuildRequires: %{python_module pandas} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests} ++++++ _service ++++++ --- /var/tmp/diff_new_pack.FH5poE/_old 2022-03-11 11:34:21.018132422 +0100 +++ /var/tmp/diff_new_pack.FH5poE/_new 2022-03-11 11:34:21.022132427 +0100 @@ -2,7 +2,7 @@ <service name="tar_scm" mode="disabled"> <param name="scm">git</param> <param name="url">https://github.com/scikit-hep/uproot4</param> - <param name="revision">4.2.0</param> + <param name="revision">4.2.1</param> <param name="subdir">tests</param> <param name="filename">tests</param> <param name="version">_none_</param> ++++++ tests.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tests/test_0033-more-interpretations-2.py new/tests/test_0033-more-interpretations-2.py --- old/tests/test_0033-more-interpretations-2.py 2022-02-10 22:41:26.000000000 +0100 +++ new/tests/test_0033-more-interpretations-2.py 2022-03-08 16:24:39.000000000 +0100 @@ -1,7 +1,6 @@ # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE -import distutils.version import json import sys @@ -77,9 +76,9 @@ with uproot.open(skhep_testdata.data_path("uproot-leaflist.root"))["tree"] as tree: result = tree["leaflist"].array(library="pd") - if distutils.version.LooseVersion( - pandas.__version__ - ) < distutils.version.LooseVersion("0.21"): + if uproot._util.parse_version(pandas.__version__) < uproot._util.parse_version( + "0.21" + ): assert list(result.columns) == ["x", "y", "z"] assert result["x"].values.tolist() == [1.1, 2.2, 3.3, 4.0, 5.5] assert result["y"].values.tolist() == [1, 2, 3, 4, 5] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tests/test_0569-fBits-is-4-bytes.py new/tests/test_0569-fBits-is-4-bytes.py --- old/tests/test_0569-fBits-is-4-bytes.py 1970-01-01 01:00:00.000000000 +0100 +++ new/tests/test_0569-fBits-is-4-bytes.py 2022-03-08 16:24:39.000000000 +0100 @@ -0,0 +1,14 @@ +# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE + +import numpy as np +import pytest +import skhep_testdata + +import uproot + + +def test(): + with uproot.open(skhep_testdata.data_path("uproot-issue-569.root")) as f: + assert f["MCTruthTree/MCTruthEvent/TObject/fBits"].array( + library="np" + ).tolist() == [50331648] ++++++ uproot-4.2.0.tar.gz -> uproot-4.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/PKG-INFO new/uproot-4.2.1/PKG-INFO --- old/uproot-4.2.0/PKG-INFO 2022-02-14 21:51:02.524072400 +0100 +++ new/uproot-4.2.1/PKG-INFO 2022-03-08 16:30:02.051114600 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: uproot -Version: 4.2.0 +Version: 4.2.1 Summary: ROOT I/O in pure Python and NumPy. Home-page: https://github.com/scikit-hep/uproot4 Download-URL: https://github.com/scikit-hep/uproot4/releases diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/pyproject.toml new/uproot-4.2.1/pyproject.toml --- old/uproot-4.2.0/pyproject.toml 2022-02-14 21:50:50.000000000 +0100 +++ new/uproot-4.2.1/pyproject.toml 2022-03-08 16:29:51.000000000 +0100 @@ -1,7 +1,6 @@ [build-system] requires = [ - "wheel", "setuptools>=42", ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/src/uproot/_util.py new/uproot-4.2.1/src/uproot/_util.py --- old/uproot-4.2.0/src/uproot/_util.py 2022-02-14 21:50:50.000000000 +0100 +++ new/uproot-4.2.1/src/uproot/_util.py 2022-03-08 16:29:51.000000000 +0100 @@ -5,7 +5,6 @@ and may be changed without notice. """ - import datetime import glob import numbers @@ -17,6 +16,7 @@ from urllib.parse import unquote, urlparse import numpy +import setuptools win = platform.system().lower().startswith("win") @@ -87,7 +87,15 @@ return out -_regularize_filter_regex = re.compile("^/(.*)/([iLmsux]*)$") +def parse_version(version): + """ + Converts a semver string into a Version object that can be compared with + ``<``, ``>=``, etc. + + Currently implemented using ``setuptools.extern.packaging.version.parse`` + (exposing that library in the return type). + """ + return setuptools.extern.packaging.version.parse(version) def from_module(obj, module_name): @@ -136,6 +144,9 @@ return True +_regularize_filter_regex = re.compile("^/(.*)/([iLmsux]*)$") + + def regularize_filter(filter): """ Convert None, str, iterable of str, wildcards, and regular expressions into diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/src/uproot/extras.py new/uproot-4.2.1/src/uproot/extras.py --- old/uproot-4.2.0/src/uproot/extras.py 2022-02-14 21:50:50.000000000 +0100 +++ new/uproot-4.2.1/src/uproot/extras.py 2022-03-08 16:29:51.000000000 +0100 @@ -11,10 +11,11 @@ import atexit import os -from distutils.version import LooseVersion import pkg_resources +from uproot._util import parse_version + def awkward(): """ @@ -32,7 +33,7 @@ to output as NumPy arrays, rather than Awkward arrays. """ ) - if LooseVersion("1") < LooseVersion(awkward.__version__) < LooseVersion("2"): + if parse_version("1") < parse_version(awkward.__version__) < parse_version("2"): return awkward else: raise ModuleNotFoundError( @@ -121,7 +122,7 @@ return False else: try: - return LooseVersion(version) < LooseVersion(min_version) + return parse_version(version) < parse_version(min_version) except TypeError: return False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/src/uproot/interpretation/identify.py new/uproot-4.2.1/src/uproot/interpretation/identify.py --- old/uproot-4.2.0/src/uproot/interpretation/identify.py 2022-02-14 21:50:50.000000000 +0100 +++ new/uproot-4.2.1/src/uproot/interpretation/identify.py 2022-03-08 16:29:51.000000000 +0100 @@ -243,17 +243,16 @@ else: source = title[left : right + 1] + try: parsed = ast.parse(source).body[0].value - except SyntaxError: - raise UnknownInterpretation( - f"cannot parse streamer title {source!r} (as Python)", - branch.file.file_path, - branch.object_path, + transformed = ast.Expression( + _float16_double32_walk_ast(parsed, branch, source) ) + spec = eval(compile(transformed, repr(title), "eval")) + except (UnknownInterpretation, SyntaxError): + spec = () - transformed = ast.Expression(_float16_double32_walk_ast(parsed, branch, source)) - spec = eval(compile(transformed, repr(title), "eval")) if ( len(spec) == 2 and uproot._util.isnum(spec[0]) @@ -271,12 +270,7 @@ low, high, num_bits = spec else: - raise UnknownInterpretation( - "cannot interpret streamer title {} as (low, high) or " - "(low, high, num_bits)".format(repr(source)), - branch.file.file_path, - branch.object_path, - ) + num_bits = "no brackets" if not is_float16: if num_bits == "no brackets": @@ -379,17 +373,12 @@ is_double32 = ( leaftype == uproot.const.kDouble32 or leaf.classname == "TLeafD32" ) + if is_float16 or is_double32: out = _float16_or_double32(branch, context, leaf, is_float16, dims) else: - if ( - branch.member("fClassName", none_if_missing=True) == "TObject" - and branch.name.split(".")[-1] == "fBits" - ): - from_dtype = numpy.dtype(">u1") - else: - from_dtype = _leaf_to_dtype(leaf, getdims=False).newbyteorder(">") + from_dtype = _leaf_to_dtype(leaf, getdims=False).newbyteorder(">") if context.get("swap_bytes", True): to_dtype = from_dtype.newbyteorder("=") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/src/uproot/interpretation/library.py new/uproot-4.2.1/src/uproot/interpretation/library.py --- old/uproot-4.2.0/src/uproot/interpretation/library.py 2022-02-14 21:50:50.000000000 +0100 +++ new/uproot-4.2.1/src/uproot/interpretation/library.py 2022-03-08 16:29:51.000000000 +0100 @@ -741,10 +741,17 @@ return concatenated -def _pandas_rangeindex(): - import pandas +def _is_pandas_rangeindex(pandas, index): + if hasattr(pandas, "RangeIndex") and isinstance(index, pandas.RangeIndex): + return True + if hasattr(index, "is_integer") and index.is_integer(): + return True + if uproot._util.parse_version(pandas.__version__) < uproot._util.parse_version( + "1.4.0" + ) and isinstance(index, pandas.Int64Index): + return True - return (getattr(pandas, "RangeIndex", pandas.Int64Index), pandas.Int64Index) + return False def _strided_to_pandas(path, interpretation, data, arrays, columns): @@ -964,7 +971,7 @@ arrays = newarrays names = pandas.MultiIndex.from_tuples(newnames) - if all(isinstance(x.index, _pandas_rangeindex()) for x in arrays.values()): + if all(_is_pandas_rangeindex(pandas, x.index) for x in arrays.values()): return _pandas_memory_efficient(pandas, arrays, names) indexes = [] @@ -986,7 +993,7 @@ for index, group, df, gn in zip(indexes, groups, dfs, group_names): for name in names: array = arrays[name] - if isinstance(array.index, _pandas_rangeindex()): + if _is_pandas_rangeindex(pandas, array.index): if flat_index is None or len(flat_index) != len( array.index ): @@ -1053,7 +1060,7 @@ flat_names = [ name for name in names - if isinstance(arrays[name].index, _pandas_rangeindex()) + if _is_pandas_rangeindex(pandas, arrays[name].index) ] if len(flat_names) > 0: flat_index = pandas.MultiIndex.from_arrays( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/src/uproot/version.py new/uproot-4.2.1/src/uproot/version.py --- old/uproot-4.2.0/src/uproot/version.py 2022-02-14 21:50:50.000000000 +0100 +++ new/uproot-4.2.1/src/uproot/version.py 2022-03-08 16:29:51.000000000 +0100 @@ -12,7 +12,7 @@ import re -__version__ = "4.2.0" +__version__ = "4.2.1" version = __version__ version_info = tuple(re.split(r"[-\.]", __version__)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/src/uproot.egg-info/PKG-INFO new/uproot-4.2.1/src/uproot.egg-info/PKG-INFO --- old/uproot-4.2.0/src/uproot.egg-info/PKG-INFO 2022-02-14 21:51:02.000000000 +0100 +++ new/uproot-4.2.1/src/uproot.egg-info/PKG-INFO 2022-03-08 16:30:01.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: uproot -Version: 4.2.0 +Version: 4.2.1 Summary: ROOT I/O in pure Python and NumPy. Home-page: https://github.com/scikit-hep/uproot4 Download-URL: https://github.com/scikit-hep/uproot4/releases diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/src/uproot.egg-info/SOURCES.txt new/uproot-4.2.1/src/uproot.egg-info/SOURCES.txt --- old/uproot-4.2.0/src/uproot.egg-info/SOURCES.txt 2022-02-14 21:51:02.000000000 +0100 +++ new/uproot-4.2.1/src/uproot.egg-info/SOURCES.txt 2022-03-08 16:30:02.000000000 +0100 @@ -174,4 +174,5 @@ tests/test_0487-implement-asdtypeinplace.py tests/test_0498-create-leaf-branch-in-extend.py tests/test_0519-remove-memmap-copy.py -tests/test_0520-dynamic-classes-cant-be-abc-subclasses.py \ No newline at end of file +tests/test_0520-dynamic-classes-cant-be-abc-subclasses.py +tests/test_0569-fBits-is-4-bytes.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/tests/test_0033-more-interpretations-2.py new/uproot-4.2.1/tests/test_0033-more-interpretations-2.py --- old/uproot-4.2.0/tests/test_0033-more-interpretations-2.py 2022-02-14 21:50:50.000000000 +0100 +++ new/uproot-4.2.1/tests/test_0033-more-interpretations-2.py 2022-03-08 16:29:51.000000000 +0100 @@ -1,7 +1,6 @@ # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE -import distutils.version import json import sys @@ -77,9 +76,9 @@ with uproot.open(skhep_testdata.data_path("uproot-leaflist.root"))["tree"] as tree: result = tree["leaflist"].array(library="pd") - if distutils.version.LooseVersion( - pandas.__version__ - ) < distutils.version.LooseVersion("0.21"): + if uproot._util.parse_version(pandas.__version__) < uproot._util.parse_version( + "0.21" + ): assert list(result.columns) == ["x", "y", "z"] assert result["x"].values.tolist() == [1.1, 2.2, 3.3, 4.0, 5.5] assert result["y"].values.tolist() == [1, 2, 3, 4, 5] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uproot-4.2.0/tests/test_0569-fBits-is-4-bytes.py new/uproot-4.2.1/tests/test_0569-fBits-is-4-bytes.py --- old/uproot-4.2.0/tests/test_0569-fBits-is-4-bytes.py 1970-01-01 01:00:00.000000000 +0100 +++ new/uproot-4.2.1/tests/test_0569-fBits-is-4-bytes.py 2022-03-08 16:29:51.000000000 +0100 @@ -0,0 +1,14 @@ +# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE + +import numpy as np +import pytest +import skhep_testdata + +import uproot + + +def test(): + with uproot.open(skhep_testdata.data_path("uproot-issue-569.root")) as f: + assert f["MCTruthTree/MCTruthEvent/TObject/fBits"].array( + library="np" + ).tolist() == [50331648] ++++++ uproot-use-packaging-module.patch ++++++ Index: uproot-4.2.1/src/uproot/_util.py =================================================================== --- uproot-4.2.1.orig/src/uproot/_util.py +++ uproot-4.2.1/src/uproot/_util.py @@ -16,7 +16,7 @@ from collections.abc import Iterable from urllib.parse import unquote, urlparse import numpy -import setuptools +import packaging win = platform.system().lower().startswith("win") @@ -92,10 +92,10 @@ def parse_version(version): Converts a semver string into a Version object that can be compared with ``<``, ``>=``, etc. - Currently implemented using ``setuptools.extern.packaging.version.parse`` + Currently implemented using ``packaging.version.parse`` (exposing that library in the return type). """ - return setuptools.extern.packaging.version.parse(version) + return packaging.version.parse(version) def from_module(obj, module_name):