summaryrefslogtreecommitdiff
path: root/archivers/py-zstandard
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2021-01-03 14:57:53 +0000
committeradam <adam@pkgsrc.org>2021-01-03 14:57:53 +0000
commit00dfb1eb14a6f0bf6673d54ffc5433098022901f (patch)
treea6ff43649d47cd65277d29d6a608b02b4c3ce2b0 /archivers/py-zstandard
parent7beadb233c2ca0acb49b9761f57e88442e92df60 (diff)
downloadpkgsrc-00dfb1eb14a6f0bf6673d54ffc5433098022901f.tar.gz
py-zstandard: updated to 0.15.1
0.15.1: Bug Fixes setup.py no longer attempts to build the C backend on PyPy. <sys/types.h> is now included before <sys/sysctl.h>. This was the case in releases prior to 0.15.0 and the include order was reversed as part of running clang-format. The old/working order has been restored. Include some private zstd C headers so we can build the C extension against a system library. The previous behavior of referencing these headers is restored. That behave is rather questionable and undermines the desire to use the system zstd. 0.15.0: Backwards Compatibility Notes Support for Python 2.7 has been dropped. Python 3.5 is now the minimum required Python version. train_dictionary() now uses the fastcover training mechanism (as opposed to cover). Some parameter values that worked with the old mechanism may not work with the new one. e.g. d must be 6 or 8 if it is defined. train_dictionary() now always calls ZDICT_optimizeTrainFromBuffer_fastCover() instead of different APIs depending on which arguments were passed. The names of various Python modules have been changed. The C extension is now built as zstandard.backend_c instead of zstd. The CFFI extension module is now built as zstandard._cffi instead of _zstd_cffi. The CFFI backend is now zstandard.backend_cffi instead of zstandard.cffi. ZstdDecompressionReader.seekable() now returns False instead of True because not all seek operations are supported and some Python code in the wild keys off this value to determine if seek() can be called for all scenarios. ZstdDecompressionReader.seek() now raises OSError instead of ValueError when the seek cannot be fulfilled. ZstdDecompressionReader.readline() and ZstdDecompressionReader.readlines() now accept an integer argument. This makes them conform with the IO interface. The methods still raise io.UnsupportedOperation. ZstdCompressionReader.__enter__ and ZstdDecompressionReader.__enter__ now raise ValueError if the instance was already closed. The deprecated overlap_size_log attribute on ZstdCompressionParameters instances has been removed. The overlap_log attribute should be used instead. The deprecated overlap_size_log argument to ZstdCompressionParameters has been removed. The overlap_log argument should be used instead. The deprecated ldm_hash_every_log attribute on ZstdCompressionParameters instances has been removed. The ldm_hash_rate_log attribute should be used instead. The deprecated ldm_hash_every_log argument to ZstdCompressionParameters has been removed. The ldm_hash_rate_log argument should be used instead. The deprecated CompressionParameters type alias to ZstdCompressionParamaters has been removed. Use ZstdCompressionParameters. The deprecated aliases ZstdCompressor.read_from() and ZstdDecompressor.read_from() have been removed. Use the corresponding read_to_iter() methods instead. The deprecated aliases ZstdCompressor.write_to() and ZstdDecompressor.write_to() have been removed. Use the corresponding stream_writer() methods instead. ZstdCompressor.copy_stream(), ZstdCompressorIterator.__next__(), and ZstdDecompressor.copy_stream() now raise the original exception on error calling the source stream's read() instead of raising ZstdError. This only affects the C backend. ZstdDecompressionObj.flush() now returns bytes instead of None. This makes it behave more similarly to flush() methods for similar types in the Python standard library. ZstdCompressionWriter.__exit__() now always calls close(). Previously, close() would not be called if the context manager raised an exception. The old behavior was inconsistent with other stream types in this package and with the behavior of Python's standard library IO types. Distribution metadata no longer lists cffi as an install_requires except when running on PyPy. Instead, cffi is listed as an extras_require. ZstdCompressor.stream_reader() and ZstdDecompressor.stream_reader() now default to closing the source stream when the instance is itself closed. To change this behavior, pass closefd=False. The CFFI backend now defines ZstdCompressor.multi_compress_to_buffer() and ZstdDecompressor.multi_decompress_to_buffer(). However, they raise NotImplementedError, as they are not yet implemented. The CFFI backend now exposes the types ZstdCompressionChunker, ZstdCompressionObj, ZstdCompressionReader, ZstdCompressionWriter, ZstdDecompressionObj, ZstdDecompressionReader, and ZstdDecompressionWriter as symbols on the zstandard module. The CFFI backend now exposes the types BufferSegment, BufferSegments, BufferWithSegments, and BufferWithSegmentsCollection. However, they are not implemented. ZstdCompressionWriter.flush() now calls flush() on the inner stream if such a method exists. However, when close() itself calls self.flush(), flush() is not called on the inner stream. ZstdDecompressionWriter.close() no longer calls flush() on the inner stream. However, ZstdDecompressionWriter.flush() still calls flush() on the inner stream. ZstdCompressor.stream_writer() and ZstdDecompressor.stream_writer() now have their write_return_read argument default to True. This brings the behavior of write() in compliance with the io.RawIOBase interface by default. The argument may be removed in a future release. ZstdCompressionParameters no longer exposes a compression_strategy property. Its constructor no longer accepts a compression_strategy argument. Use the strategy property/argument instead. Bug Fixes Fix a memory leak in stream_reader decompressor when reader is closed before reading everything. (Patch by Pierre Fersing.) The C backend now properly checks for errors after calling IO methods on inner streams in various methods. ZstdCompressionWriter.write() now catches exceptions when calling the inner stream's write(). ZstdCompressionWriter.flush() on inner stream's write(). ZstdCompressor.copy_stream() on dest stream's write(). ZstdDecompressionWriter.write() on inner stream's write(). ZstdDecompressor.copy_stream() on dest stream's write(). Changes Bundled zstandard library upgraded from 1.4.5 to 1.4.8. The bundled zstandard library is now using the single C source file distribution. The 2 main header files are still present, as these are needed by CFFI to generate the CFFI bindings. PyBuffer instances are no longer checked to be C contiguous and have a single dimension. The former was redundant with what PyArg_ParseTuple() already did and the latter is not necessary in practice because very few extension modules create buffers with more than 1 dimension. Added Python typing stub file for the zstandard module. The make_cffi.py script should now respect the CC environment variable for locating the compiler. CI now properly uses the cffi backend when running all tests. train_dictionary() has been rewritten to use the fastcover APIs and to consistently call ZDICT_optimizeTrainFromBuffer_fastCover() instead of different C APIs depending on what arguments were passed. The function also now accepts arguments f, split_point, and accel, which are parameters unique to fastcover. CI now tests and builds wheels for Python 3.9. zstd.c file renamed to c-ext/backend_c.c. All built/installed Python modules are now in the zstandard package. Previously, there were modules in other packages. C source code is now automatically formatted with clang-format. ZstdCompressor.stream_writer(), ZstdCompressor.stream_reader(), ZstdDecompressor.stream_writer(), and ZstdDecompressor.stream_reader() now accept a closefd argument to control whether the underlying stream should be closed when the ZstdCompressionWriter, ZstdCompressReader, ZstdDecompressionWriter, or ZstdDecompressionReader is closed. There is now a zstandard.open() function for returning a file object with zstd (de)compression. The zstandard module now exposes a backend_features attribute containing a set of strings denoting optional features present in that backend. This can be used to sniff feature support by performing a string lookup instead of sniffing for API presence or behavior. Python docstrings have been moved from the C backend to the CFFI backend. Sphinx docs have been updated to generate API documentation via the CFFI backend. Documentation for Python APIs is now fully defined via Python docstrings instead of spread across Sphinx ReST files and source code. ZstdCompressionParameters now exposes a strategy property. There are now compress() and decompress() convenience functions on the zstandard module. These are simply wrappers around the corresponding APIs on ZstdCompressor and ZstdDecompressor.
Diffstat (limited to 'archivers/py-zstandard')
-rw-r--r--archivers/py-zstandard/Makefile12
-rw-r--r--archivers/py-zstandard/PLIST14
-rw-r--r--archivers/py-zstandard/distinfo11
-rw-r--r--archivers/py-zstandard/patches/patch-zstd.c17
4 files changed, 19 insertions, 35 deletions
diff --git a/archivers/py-zstandard/Makefile b/archivers/py-zstandard/Makefile
index 96da66da24e..be12ac2701a 100644
--- a/archivers/py-zstandard/Makefile
+++ b/archivers/py-zstandard/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.17 2020/12/06 10:55:42 adam Exp $
+# $NetBSD: Makefile,v 1.18 2021/01/03 14:57:53 adam Exp $
-DISTNAME= zstandard-0.14.1
+DISTNAME= zstandard-0.15.1
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES= archivers python
MASTER_SITES= ${MASTER_SITE_PYPI:=z/zstandard/}
@@ -11,13 +11,13 @@ COMMENT= Zstandard bindings for Python
LICENSE= modified-bsd
DEPENDS+= ${PYPKGPREFIX}-cffi>=1.11:../../devel/py-cffi
-
-PYTHON_VERSIONED_DEPENDENCIES= hypothesis:test
+TEST_DEPENDS+= ${PYPKGPREFIX}-hypothesis-[0-9]*:../../devel/py-hypothesis
PYSETUPBUILDARGS+= --system-zstd
-BUILDLINK_API_DEPENDS.zstd+= zstd>=1.4.5
+PYTHON_VERSIONS_INCOMPATIBLE= 27
+
+BUILDLINK_API_DEPENDS.zstd+= zstd>=1.4.8
.include "../../archivers/zstd/buildlink3.mk"
.include "../../lang/python/egg.mk"
-.include "../../lang/python/versioned_dependencies.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/archivers/py-zstandard/PLIST b/archivers/py-zstandard/PLIST
index cc826f457fa..d72dee004cf 100644
--- a/archivers/py-zstandard/PLIST
+++ b/archivers/py-zstandard/PLIST
@@ -1,14 +1,16 @@
-@comment $NetBSD: PLIST,v 1.5 2019/02/26 06:42:27 adam Exp $
+@comment $NetBSD: PLIST,v 1.6 2021/01/03 14:57:53 adam Exp $
${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
${PYSITELIB}/${EGG_INFODIR}/requires.txt
${PYSITELIB}/${EGG_INFODIR}/top_level.txt
-${PYSITELIB}/_zstd_cffi.so
${PYSITELIB}/zstandard/__init__.py
${PYSITELIB}/zstandard/__init__.pyc
+${PYSITELIB}/zstandard/__init__.pyi
${PYSITELIB}/zstandard/__init__.pyo
-${PYSITELIB}/zstandard/cffi.py
-${PYSITELIB}/zstandard/cffi.pyc
-${PYSITELIB}/zstandard/cffi.pyo
-${PYSITELIB}/zstd.so
+${PYSITELIB}/zstandard/_cffi.so
+${PYSITELIB}/zstandard/backend_c.so
+${PYSITELIB}/zstandard/backend_cffi.py
+${PYSITELIB}/zstandard/backend_cffi.pyc
+${PYSITELIB}/zstandard/backend_cffi.pyo
+${PYSITELIB}/zstandard/py.typed
diff --git a/archivers/py-zstandard/distinfo b/archivers/py-zstandard/distinfo
index e6dd57e0210..03d5c6b6a37 100644
--- a/archivers/py-zstandard/distinfo
+++ b/archivers/py-zstandard/distinfo
@@ -1,7 +1,6 @@
-$NetBSD: distinfo,v 1.15 2020/12/06 10:55:42 adam Exp $
+$NetBSD: distinfo,v 1.16 2021/01/03 14:57:53 adam Exp $
-SHA1 (zstandard-0.14.1.tar.gz) = 93090c79a331d4ceffad7fa762b7297aee62a9db
-RMD160 (zstandard-0.14.1.tar.gz) = 70aabbd898e364ed52927126e5220c3bb2b3fa67
-SHA512 (zstandard-0.14.1.tar.gz) = e49f294816f0c7da35914363dbbdfcc4d432f7fa8367192e07a5d0c093ec8af76966fd0a95b4e8316091f056a8027c383ca73cc9ed506b29e2f9a31bc9ad3379
-Size (zstandard-0.14.1.tar.gz) = 676849 bytes
-SHA1 (patch-zstd.c) = d6566abae99231175401ce130cb2260b040d72e8
+SHA1 (zstandard-0.15.1.tar.gz) = 59be1c44cd73f8513b8f2b37ed9fe69af1a0c1e8
+RMD160 (zstandard-0.15.1.tar.gz) = 5024d775b7c377a90ce70f9330e2a610e8de5928
+SHA512 (zstandard-0.15.1.tar.gz) = 7aabe647fa8c9a696084da6544c27287fe7d57e3a0ce2594c061fd20136e147ded4ea3da3648f6ef93c49636edc1d04ca4f29561514fb13f1a5d0340cd51996b
+Size (zstandard-0.15.1.tar.gz) = 992126 bytes
diff --git a/archivers/py-zstandard/patches/patch-zstd.c b/archivers/py-zstandard/patches/patch-zstd.c
deleted file mode 100644
index 0038b204e24..00000000000
--- a/archivers/py-zstandard/patches/patch-zstd.c
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-zstd.c,v 1.5 2020/06/14 13:53:06 adam Exp $
-
-Allow newer zstd.
-
---- zstd.c.orig 2019-12-28 17:43:58.000000000 +0000
-+++ zstd.c
-@@ -210,10 +210,6 @@ void zstd_module_init(PyObject* m) {
- We detect this mismatch here and refuse to load the module if this
- scenario is detected.
- */
-- if (ZSTD_VERSION_NUMBER != 10405 || ZSTD_versionNumber() != 10405) {
-- PyErr_SetString(PyExc_ImportError, "zstd C API mismatch; Python bindings not compiled against expected zstd version");
-- return;
-- }
-
- bufferutil_module_init(m);
- compressionparams_module_init(m);