Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-numcodecs for openSUSE:Factory checked in at 2023-01-14 00:02:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-numcodecs (Old) and /work/SRC/openSUSE:Factory/.python-numcodecs.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-numcodecs" Sat Jan 14 00:02:55 2023 rev:4 rq:1058132 version:0.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-numcodecs/python-numcodecs.changes 2022-04-25 23:36:18.390481951 +0200 +++ /work/SRC/openSUSE:Factory/.python-numcodecs.new.32243/python-numcodecs.changes 2023-01-14 00:03:36.097845065 +0100 @@ -1,0 +2,105 @@ +Thu Jan 12 16:00:40 UTC 2023 - Ben Greiner <c...@bnavigator.de> + +- Update to 0.11.0 + * Speed up isinstance checks of + numcodecs.ndarray_like.NDArrayLike, + numcodecs.ndarray_like.DType and + numcodecs.ndarray_like.FlagsObj. By Andreas Poehlmann, #379. + * Remove unnecessary None argument to .get(), it is the default + value. By Dimitri Papadopoulos Orfanos, #395. + * Apply refurb suggestions. By Dimitri Papadopoulos Orfanos, + #372. + * Migrate codespell configuration to pyproject.toml and get rid + of setup.cfg. By Dimitri Papadopoulos Orfanos #374. + * Unvendor cpuinfo. By Dimitri Papadopoulos Orfanos #373. + * Drop headers. By John Kirkham, #375. + * Remove Python 2 code. By Dimitri Papadopoulos Orfanos #368, + #387. + * Support Python 3.11. By Dimitri Papadopoulos Orfanos, #369. + * Drop Python 3.7. By John Kirkham,, #405 #406. + * Test with zfpy 1.0.0. By John Kirkham, #385. + * Remove vendored C files and re-generate them on the fly using + Cython. Add a pyproject.toml file to define Cython as a build + dependency. By Dimitri Papadopoulos Orfanos, #369. + * Add tests for all registry classes. By Josh Moore, #349. + * Finish pyproject.toml migration. By John Kirkham #382. +- Add numcodecs-pr417-raggednumpy.patch + * gh#zarr-developers/numcodecs#417 +- Refresh unbundle-libs.patch for system blosc supporting snappy + * gh#zarr-developers/numcodecs#264 + +------------------------------------------------------------------- +Sun Sep 25 20:23:44 UTC 2022 - Arun Persaud <a...@gmx.de> + +- specfile: + * update copyright year + * require python >= 3.7 + +- update to version 0.10.2: + * Fix + + Add BitRound (0.10.0) to registry. By Josh Moore, #342. + +- changes from version 0.10.1: + * Maintenance + + Add entrypoints to setup.py. By Josh Moore, #332. + + Fix spelling. By Dimitri Papadopoulos Orfanos, #336. + + Drop Python 3.6 from tests By Dimitri Papadopoulos Orfanos, + #338, #339. + + Remove trailing spaces and empty lines. By Dimitri Papadopoulos + Orfanos, #341. + + Add LGTM.com configuration file By Dimitri Papadopoulos Orfanos, + #337. + +- changes from version 0.10.0: + * Enhancements + + Add support of alternative array classes (other than NumPy + arrays) By Mads R. B. Kristensen, #305. + + Add ability to find codecs via entrypoint numcodecs.codecs. By + Martin Durant, #290. + + Add bitround codec By Ryan Abernathy and Martin Durant, #298. + + Introduce a flat option to ensure_contiguous_ndarray to switch + off flatten for ZFPY codec By Haiying Xu, #307. + * Bug fixes + + Fix a flatten array error for ZFPY, ZFPY codec is supported on + Python 3.9 and 3.10 on Linux and MacOS, the docs about ZFPY is + also available. By Haiying Xu, John Kirkham, Ryan Abernathey + #303. + + Codex: make encode and decode @abstractmethods By Mads + R. B. Kristensen, #306. + + Fix expected result test for Shuffle. By Elliott Sales de + Andrade, #282. + * Maintenance + + Multiple code linting fixes. By Dimitri Papadopoulos Orfanos, + #295, #294, #293, and #292. + + Drop Python 3.6 By Josh Moore, #318. + + Fix macOS Python 3.10 By John Kirkham, #311. + + chore: bump cibuildwheel version, use action By Henry Schreiner, + #309. + + Specify language as âenâ instead of None. By John Kirkham, #329. + + Move master to main. By John Kirkham, #322. + + Drop fastparquet benchmark. By John Kirkham, #321. + + Trim wheel builds. By John Kirkham, #320. + +- changes from version 0.9.1: + * Fix inaccurate docstrings for Blosc. By James Webber, #287. + +- changes from version 0.9.0: + * c-blosc upgrade 1.18.1 -> 1.21.0. Warning: this temporarily + removes support for snappy compression! By kindjacket, #283. + * Fix an ImportError with Blosc on Android. By Daniel Jewell, #284. + +- changes from version 0.8.1: + * Fix an ImportError with Blosc on Android. By Daniel Jewell, #284. + +- changes from version 0.8.0: + * The numcodecs.zfpy.ZFPY codec is now supported on Python 3.8 if + zfpy==0.5.5 is installed. By haiying xu, #229. + * Add support for byte Shuffle filter By Paul Branson and Martin + Durant #273. + * Update Windows + Mac CI to run all tests. By Jackson Maxfield + Brown, #276. Help from Oleg Höfling, #273. + * Update cpuinfo to 8.0.0. By Florian Jetter, #280. + * Drop out-of-date manual release docs. By John Kirkham, #272. + * Add support for Python 3.9 and Update GitHub Actions. + +------------------------------------------------------------------- Old: ---- numcodecs-0.7.3.tar.gz New: ---- numcodecs-0.11.0.tar.gz numcodecs-pr417-raggednumpy.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-numcodecs.spec ++++++ --- /var/tmp/diff_new_pack.AtU9gQ/_old 2023-01-14 00:03:37.933855759 +0100 +++ /var/tmp/diff_new_pack.AtU9gQ/_new 2023-01-14 00:03:37.977856015 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-numcodecs # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,21 +16,24 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define skip_python2 1 -%define skip_python36 1 Name: python-numcodecs -Version: 0.7.3 +Version: 0.11.0 Release: 0 Summary: Buffer compression and transformation codecs License: MIT URL: https://github.com/zarr-developers/numcodecs Source: https://files.pythonhosted.org/packages/source/n/numcodecs/numcodecs-%{version}.tar.gz -# PATCH-FEATURE-UPSTREAM unbundle-libs.patch -- unbundle system libs +# PATCH-FEATURE-UPSTREAM unbundle-libs.patch -- unbundle system libs gh#zarr-developers/numcodecs#264 Patch0: unbundle-libs.patch +# PATCH-FIX-UPSTREAM numcodecs-pr417-raggednumpy.patch gh#zarr-developers/numcodecs#417 +Patch1: numcodecs-pr417-raggednumpy.patch BuildRequires: %{python_module Cython} -BuildRequires: %{python_module setuptools > 18.0} -BuildRequires: %{python_module setuptools_scm > 1.5.4} +BuildRequires: %{python_module base >= 3.8} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module py-cpuinfo} +BuildRequires: %{python_module setuptools > 64} +BuildRequires: %{python_module setuptools_scm > 6.2} +BuildRequires: %{python_module wheel} BuildRequires: blosc-devel BuildRequires: cmake BuildRequires: fdupes @@ -40,10 +43,14 @@ BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(libzstd) BuildRequires: pkgconfig(zlib) +Requires: python-entrypoints Requires: python-numpy >= 1.7 Suggests: python-msgpack +Suggests: python-zfpy >= 1 # SECTION test requirements BuildRequires: %{python_module numpy >= 1.7} +BuildRequires: %{python_module entrypoints} +BuildRequires: %{python_module msgpack} BuildRequires: %{python_module pytest} # /SECTION %python_subpackages @@ -56,22 +63,23 @@ %autosetup -p1 -n numcodecs-%{version} # use system libraries instead of bundled ones rm -r c-blosc +sed -i 's/--cov=numcodecs --cov-report xml//' pyproject.toml %build export CFLAGS="%{optflags}" export DISABLE_NUMCODECS_AVX2=1 -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %check -%pytest_arch +%pytest_arch --pyargs numcodecs -rsfE %files %{python_files} %doc README.rst -%license LICENSE +%license LICENSE.txt %{python_sitearch}/numcodecs %{python_sitearch}/numcodecs-%{version}*-info ++++++ numcodecs-0.7.3.tar.gz -> numcodecs-0.11.0.tar.gz ++++++ ++++ 198771 lines of diff (skipped) ++++++ numcodecs-pr417-raggednumpy.patch ++++++ diff --git a/numcodecs/json.py b/numcodecs/json.py index 670f223..b803a77 100644 --- a/numcodecs/json.py +++ b/numcodecs/json.py @@ -54,7 +54,10 @@ class JSON(Codec): self._decoder = _json.JSONDecoder(**self._decoder_config) def encode(self, buf): - buf = np.asarray(buf) + try: + buf = np.asarray(buf) + except ValueError: + buf = np.asarray(buf, dtype=object) items = buf.tolist() items.extend((buf.dtype.str, buf.shape)) return self._encoder.encode(items).encode(self._text_encoding) diff --git a/numcodecs/msgpacks.py b/numcodecs/msgpacks.py index 026f583..6556498 100644 --- a/numcodecs/msgpacks.py +++ b/numcodecs/msgpacks.py @@ -52,7 +52,10 @@ class MsgPack(Codec): self.raw = raw def encode(self, buf): - buf = np.asarray(buf) + try: + buf = np.asarray(buf) + except ValueError: + buf = np.asarray(buf, dtype=object) items = buf.tolist() items.extend((buf.dtype.str, buf.shape)) return msgpack.packb(items, use_bin_type=self.use_bin_type, diff --git a/numcodecs/tests/test_json.py b/numcodecs/tests/test_json.py index 7e8fcd6..8dac2b4 100644 --- a/numcodecs/tests/test_json.py +++ b/numcodecs/tests/test_json.py @@ -2,7 +2,7 @@ import itertools import numpy as np - +import pytest from numcodecs.json import JSON from numcodecs.tests.common import (check_config, check_repr, check_encode_decode_array, @@ -53,21 +53,23 @@ def test_backwards_compatibility(): check_backwards_compatibility(JSON.codec_id, arrays, codecs) -def test_non_numpy_inputs(): +@pytest.mark.parametrize( + "input_data, dtype", + [ + ([0, 1], None), + ([[0, 1], [2, 3]], None), + ([[0], [1], [2, 3]], object), + ([[[0, 0]], [[1, 1]], [[2, 3]]], None), + (["1"], None), + (["11", "11"], None), + (["11", "1", "1"], None), + ([{}], None), + ([{"key": "value"}, ["list", "of", "strings"]], object), + ] +) +def test_non_numpy_inputs(input_data, dtype): # numpy will infer a range of different shapes and dtypes for these inputs. # Make sure that round-tripping through encode preserves this. - data = [ - [0, 1], - [[0, 1], [2, 3]], - [[0], [1], [2, 3]], - [[[0, 0]], [[1, 1]], [[2, 3]]], - ["1"], - ["11", "11"], - ["11", "1", "1"], - [{}], - [{"key": "value"}, ["list", "of", "strings"]], - ] - for input_data in data: - for codec in codecs: - output_data = codec.decode(codec.encode(input_data)) - assert np.array_equal(np.array(input_data), output_data) + for codec in codecs: + output_data = codec.decode(codec.encode(input_data)) + assert np.array_equal(np.array(input_data, dtype=dtype), output_data) diff --git a/numcodecs/tests/test_msgpacks.py b/numcodecs/tests/test_msgpacks.py index 6aeadcf..d76aa12 100644 --- a/numcodecs/tests/test_msgpacks.py +++ b/numcodecs/tests/test_msgpacks.py @@ -2,6 +2,7 @@ import unittest import numpy as np +import pytest try: @@ -52,30 +53,32 @@ def test_backwards_compatibility(): check_backwards_compatibility(codec.codec_id, arrays, [codec]) -def test_non_numpy_inputs(): +@pytest.mark.parametrize( + "input_data, dtype", + [ + ([0, 1], None), + ([[0, 1], [2, 3]], None), + ([[0], [1], [2, 3]], object), + ([[[0, 0]], [[1, 1]], [[2, 3]]], None), + (["1"], None), + (["11", "11"], None), + (["11", "1", "1"], None), + ([{}], None), + ([{"key": "value"}, ["list", "of", "strings"]], object), + ([b"1"], None), + ([b"11", b"11"], None), + ([b"11", b"1", b"1"], None), + ([{b"key": b"value"}, [b"list", b"of", b"strings"]], object), + ] +) +def test_non_numpy_inputs(input_data, dtype): codec = MsgPack() # numpy will infer a range of different shapes and dtypes for these inputs. # Make sure that round-tripping through encode preserves this. - data = [ - [0, 1], - [[0, 1], [2, 3]], - [[0], [1], [2, 3]], - [[[0, 0]], [[1, 1]], [[2, 3]]], - ["1"], - ["11", "11"], - ["11", "1", "1"], - [{}], - [{"key": "value"}, ["list", "of", "strings"]], - [b"1"], - [b"11", b"11"], - [b"11", b"1", b"1"], - [{b"key": b"value"}, [b"list", b"of", b"strings"]], - ] - for input_data in data: - actual = codec.decode(codec.encode(input_data)) - expect = np.array(input_data) - assert expect.shape == actual.shape - assert np.array_equal(expect, actual) + actual = codec.decode(codec.encode(input_data)) + expect = np.array(input_data, dtype=dtype) + assert expect.shape == actual.shape + assert np.array_equal(expect, actual) def test_encode_decode_shape_dtype_preserved(): ++++++ unbundle-libs.patch ++++++ --- /var/tmp/diff_new_pack.AtU9gQ/_old 2023-01-14 00:03:38.801860815 +0100 +++ /var/tmp/diff_new_pack.AtU9gQ/_new 2023-01-14 00:03:38.805860839 +0100 @@ -1,8 +1,8 @@ -Index: numcodecs-0.7.2/setup.py +Index: numcodecs-0.11.0/setup.py =================================================================== ---- numcodecs-0.7.2.orig/setup.py -+++ numcodecs-0.7.2/setup.py -@@ -112,6 +112,7 @@ def blosc_extension(): +--- numcodecs-0.11.0.orig/setup.py ++++ numcodecs-0.11.0/setup.py +@@ -104,6 +104,7 @@ def blosc_extension(): Extension('numcodecs.blosc', sources=sources + blosc_sources, include_dirs=include_dirs, @@ -10,7 +10,7 @@ define_macros=define_macros, extra_compile_args=extra_compile_args, ), -@@ -152,6 +153,7 @@ def zstd_extension(): +@@ -138,6 +139,7 @@ def zstd_extension(): Extension('numcodecs.zstd', sources=sources + zstd_sources, include_dirs=include_dirs, @@ -18,7 +18,7 @@ define_macros=define_macros, extra_compile_args=extra_compile_args, ), -@@ -185,6 +187,7 @@ def lz4_extension(): +@@ -165,6 +167,7 @@ def lz4_extension(): Extension('numcodecs.lz4', sources=sources + lz4_sources, include_dirs=include_dirs, @@ -26,4 +26,24 @@ define_macros=define_macros, extra_compile_args=extra_compile_args, ), +Index: numcodecs-0.11.0/numcodecs/tests/test_blosc.py +=================================================================== +--- numcodecs-0.11.0.orig/numcodecs/tests/test_blosc.py ++++ numcodecs-0.11.0/numcodecs/tests/test_blosc.py +@@ -155,10 +155,11 @@ def test_compress_complib(use_threads): + } + blosc.use_threads = use_threads + for cname in blosc.list_compressors(): +- enc = blosc.compress(arr, cname.encode(), 1, Blosc.NOSHUFFLE) +- complib = blosc.cbuffer_complib(enc) +- expected_complib = expected_complibs[cname] +- assert complib == expected_complib ++ if cname in expected_complibs: ++ enc = blosc.compress(arr, cname.encode(), 1, Blosc.NOSHUFFLE) ++ complib = blosc.cbuffer_complib(enc) ++ expected_complib = expected_complibs[cname] ++ assert complib == expected_complib + with pytest.raises(ValueError): + # capitalized cname + blosc.compress(arr, b'LZ4', 1)