diff --git a/packages/p/python-bloscpack/.files b/packages/p/python-bloscpack/.files index e201b67e09e..d42fb4f2139 100644 Binary files a/packages/p/python-bloscpack/.files and b/packages/p/python-bloscpack/.files differ diff --git a/packages/p/python-bloscpack/.rev b/packages/p/python-bloscpack/.rev index dc5c7e39e56..1522634b91c 100644 --- a/packages/p/python-bloscpack/.rev +++ b/packages/p/python-bloscpack/.rev @@ -56,4 +56,15 @@ 946886 + + 414007d86f5d26983958a47bb9829a0d + 0.16.0 + + dimstar_suse + - Add drop-python2-support.patch to remove python-six + gh#Blosc/bloscpack#118 +- Remove python_module definition + + 1033055 + diff --git a/packages/p/python-bloscpack/drop-python2-support.patch b/packages/p/python-bloscpack/drop-python2-support.patch new file mode 100644 index 00000000000..37d9891f8f4 --- /dev/null +++ b/packages/p/python-bloscpack/drop-python2-support.patch @@ -0,0 +1,212 @@ +Index: bloscpack-0.16.0/bloscpack/args.py +=================================================================== +--- bloscpack-0.16.0.orig/bloscpack/args.py ++++ bloscpack-0.16.0/bloscpack/args.py +@@ -3,7 +3,6 @@ + + + import blosc +-from six import integer_types, string_types + + + from .abstract_objects import (MutableMappingObject, +@@ -181,7 +180,7 @@ def calculate_nchunks(in_file_size, chun + return (1, 0, 0) + log.verbose("Input was length zero, ignoring 'chunk_size'") + # convert a human readable description to an int +- if isinstance(chunk_size, string_types): ++ if isinstance(chunk_size, str): + chunk_size = reverse_pretty(chunk_size) + check_range('chunk_size', chunk_size, 1, blosc.BLOSC_MAX_BUFFERSIZE) + # downcast +@@ -264,7 +263,7 @@ def _handle_max_apps(offsets, nchunks, m + # it's a callable all right + log.debug("max_app_chunks is a callable") + max_app_chunks = max_app_chunks(nchunks) +- if not isinstance(max_app_chunks, integer_types): ++ if not isinstance(max_app_chunks, int): + raise ValueError( + "max_app_chunks callable returned a non integer " + "of type '%s'" % type(max_app_chunks)) +@@ -272,7 +271,7 @@ def _handle_max_apps(offsets, nchunks, m + if max_app_chunks < 0: + raise ValueError( + 'max_app_chunks callable returned a negative integer') +- elif isinstance(max_app_chunks, integer_types): ++ elif isinstance(max_app_chunks, int): + # it's a plain int, check its range + log.debug("max_app_chunks is an int") + check_range('max_app_chunks', max_app_chunks, 0, MAX_CHUNKS) +@@ -425,7 +424,7 @@ class MetadataArgs(MutableMappingObject) + def effective_max_meta_size(self, meta_size): + if hasattr(self.max_meta_size, '__call__'): + max_meta_size = self.max_meta_size(meta_size) +- elif isinstance(self.max_meta_size, integer_types): ++ elif isinstance(self.max_meta_size, int): + max_meta_size = self.max_meta_size + log.debug('max meta size is deemed to be: %d' % max_meta_size) + return max_meta_size +Index: bloscpack-0.16.0/bloscpack/file_io.py +=================================================================== +--- bloscpack-0.16.0.orig/bloscpack/file_io.py ++++ bloscpack-0.16.0/bloscpack/file_io.py +@@ -8,8 +8,6 @@ import itertools + import os.path as path + + import blosc +-import six +-from six.moves import xrange + from deprecated import deprecated + + +@@ -86,7 +84,7 @@ def _write_metadata(output_fp, metadata, + serializer_impl = SERIALIZERS_LOOKUP[metadata_args.magic_format] + metadata = serializer_impl.dumps(metadata) + meta_size = len(metadata) +- if six.PY3 and isinstance(metadata, str): ++ if isinstance(metadata, str): + metadata = metadata.encode() + if metadata_args.should_compress: + codec_impl = metadata_args.meta_codec_impl +@@ -128,7 +126,7 @@ def _write_metadata(output_fp, metadata, + output_fp.write(raw_metadata_header) + output_fp.write(metadata) + prealloc = max_meta_size - meta_comp_size +- for i in xrange(prealloc): ++ for i in range(prealloc): + output_fp.write(b'\x00') + metadata_total += prealloc + log.debug("metadata has %d preallocated empty bytes" % prealloc) +@@ -227,7 +225,7 @@ def _read_metadata(input_fp): + ('compressed' if metadata_header.meta_codec != 'None' else + 'uncompressed', metadata_header.meta_comp_size)) + serializer_impl = SERIALIZERS_LOOKUP[metadata_header.magic_format] +- if six.PY3 and isinstance(metadata, bytes): ++ if isinstance(metadata, bytes): + metadata = metadata.decode() + metadata = serializer_impl.loads(metadata) + return metadata, metadata_header +@@ -257,7 +255,7 @@ def _read_offsets(input_fp, bloscpack_he + offsets_raw = input_fp.read(8 * total_entries) + log.debug('Read raw offsets: %s' % repr(offsets_raw)) + offsets = [decode_int64(offsets_raw[j - 8:j]) for j in +- xrange(8, bloscpack_header.nchunks * 8 + 1, 8)] ++ range(8, bloscpack_header.nchunks * 8 + 1, 8)] + log.debug('Offsets: %s' % offsets) + return offsets + else: +@@ -363,7 +361,7 @@ class CompressedFPSource(CompressedSourc + self.nchunks = self.bloscpack_header.nchunks + + def __iter__(self): +- for i in xrange(self.nchunks): ++ for i in range(self.nchunks): + compressed, header, digest = _read_compressed_chunk_fp(self.input_fp, self.checksum_impl) + compressed(digest) + +Index: bloscpack-0.16.0/bloscpack/headers.py +=================================================================== +--- bloscpack-0.16.0.orig/bloscpack/headers.py ++++ bloscpack-0.16.0/bloscpack/headers.py +@@ -11,7 +11,6 @@ except ImportError: + + + import blosc +-from six import PY3, integer_types, binary_type + + from .abstract_objects import (MutableMappingObject, + ) +@@ -40,7 +39,7 @@ from . import log + + def check_range(name, value, min_, max_): + """ Check that a variable is in range. """ +- if not isinstance(value, integer_types): ++ if not isinstance(value, int): + raise TypeError("'%s' must be of type 'int'" % name) + elif not min_ <= value <= max_: + raise ValueError( +@@ -49,7 +48,7 @@ def check_range(name, value, min_, max_) + + + def _check_str(name, value, max_len): +- if not isinstance(value, binary_type): ++ if not isinstance(value, bytes): + raise TypeError("'%s' must be of type 'str'/'bytes'" % name) + elif len(value) > max_len: + raise ValueError("'%s' can be of max length '%i' but is: '%s'" % +@@ -103,10 +102,7 @@ def check_options_zero(options, indices) + + + def decode_uint8(byte): +- if PY3: +- return byte +- else: +- return struct.unpack(' + +- Add drop-python2-support.patch to remove python-six + gh#Blosc/bloscpack#118 +- Remove python_module definition + ------------------------------------------------------------------- Sun Jan 16 16:12:38 UTC 2022 - Benjamin Greiner diff --git a/packages/p/python-bloscpack/python-bloscpack.spec b/packages/p/python-bloscpack/python-bloscpack.spec index fe3325bcf07..aa7dc2be746 100644 --- a/packages/p/python-bloscpack/python-bloscpack.spec +++ b/packages/p/python-bloscpack/python-bloscpack.spec @@ -1,7 +1,7 @@ # # spec file for package python-bloscpack # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,8 +16,6 @@ # -%{?!python_module:%define python_module() python3-%{**}} -%define skip_python2 1 Name: python-bloscpack Version: 0.16.0 Release: 0 @@ -28,12 +26,13 @@ Source: https://files.pythonhosted.org/packages/source/b/bloscpack/blosc # PATCH-FEATURE-UPSTREAM remove_nose.patch gh#Blosc/bloscpack#99 mcepl@suse.com # Remove nose dependency Patch0: remove_nose.patch +# PATCH-FIX-UPSTREAM drop-python2-support.patch gh#Blosc/bloscpack#118 +Patch1: drop-python2-support.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-blosc Requires: python-numpy -Requires: python-six Requires(post): update-alternatives Requires(postun):update-alternatives Recommends: cryptography >= 1.3.4 @@ -46,7 +45,6 @@ BuildRequires: %{python_module cryptography >= 1.3.4} BuildRequires: %{python_module numpy} BuildRequires: %{python_module pyOpenSSL >= 0.14} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module six} # /SECTION %python_subpackages