Skip to content

Commit

Permalink
For issue #73 - update libzstd to 1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Dryabzhinsky committed Jan 3, 2022
1 parent 43c7918 commit 30fccb1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 23 deletions.
4 changes: 2 additions & 2 deletions PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: zstd
Version: 1.5.0.4
Version: 1.5.1.0
Summary: Simple python bindings to Yann Collet ZSTD compression library
Home-page: https://github.com/sergey-dryabzhinsky/python-zstd
Author: Sergey Dryabzhinsky
Author-email: sergey.dryabzhinsky@gmail.com
License: BSD
Download-URL: https://github.com/sergey-dryabzhinsky/python-zstd/archive/v1.5.0.4.tar.gz
Download-URL: https://github.com/sergey-dryabzhinsky/python-zstd/archive/v1.5.1.0.tar.gz
Description: Simple ZSTandarD bindings for Python
Keywords: zstd,zstandard,compression
Platform: POSIX
18 changes: 11 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ python-zstd
.. image:: https://travis-ci.org/sergey-dryabzhinsky/python-zstd.svg?branch=master
:target: https://travis-ci.org/sergey-dryabzhinsky/python-zstd

Simple python bindings to Yann Collet ZSTD compression library
Simple python bindings to Yann Collet ZSTD compression library.

**Zstd**, short for Zstandard, is a new lossless compression algorithm,
which provides both good compression ratio *and* speed for your standard compression needs.
Expand Down Expand Up @@ -62,18 +62,19 @@ Build from source
>>> $ python setup.py build_ext clean
>>> $ python3 setup.py build_ext clean

Note: legacy format support disabled by default.
Note: Zstd legacy format support disabled by default.
To build with Zstd legacy versions support - pass ``--legacy`` option to setup.py script:

>>> $ python setup.py build_ext --legacy clean

Note: PyZstd legacy format support disabled by default.
Note: Python-Zstd legacy format support removed since 1.5.0.
If you need to convert old data - checkout 1.4.9.1 module version. Support of it disabled by default.
To build with python-zstd legacy format support (pre 1.1.2) - pass ``--pyzstd-legacy`` option to setup.py script:

>>> $ python setup.py build_ext --pyzstd-legacy clean

If you want to build with existing distribution of libzstd just add ``--external`` option.
But beware! Legacy formats support is unknown in this case.
But beware! Legacy formats support state is unknown in this case.
And if your version not equal with python-zstd - tests may not pass.

>>> $ python setup.py build_ext --external clean
Expand Down Expand Up @@ -126,6 +127,9 @@ ZSTD_uncompress (data): string|bytes
version (): string|bytes
Returns this module doted version string.

The first three digits are folow libzstd version.
Fourth digit - module release number for that version.

Since: 1.3.4.3

ZSTD_version (): string|bytes
Expand Down Expand Up @@ -183,11 +187,11 @@ Module has simple API:
>>> dir(zstd)
['Error', 'ZSTD_compress', 'ZSTD_external', 'ZSTD_uncompress', 'ZSTD_version', 'ZSTD_version_number', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'compress', 'decompress', 'dumps', 'loads', 'uncompress', 'version']
>>> zstd.version()
'1.5.0.4'
'1.5.1.0'
>>> zstd.ZSTD_version()
'1.5.0'
'1.5.1'
>>> zstd.ZSTD_version_number()
10500
10501
>>> zstd.ZSTD_external()
0

Expand Down
30 changes: 20 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
from setuptools.command.build_ext import build_ext

# ZSTD version
VERSION = (1, 5, 0,)
VERSION = (1, 5, 1,)
VERSION_STR = ".".join([str(x) for x in VERSION])

# Package version
PKG_VERSION = VERSION
# Minor versions
PKG_VERSION += ("4",)
PKG_VERSION += ("0",)
PKG_VERSION_STR = ".".join([str(x) for x in PKG_VERSION])

###
Expand Down Expand Up @@ -60,12 +60,16 @@
ext_libraries=["zstd"]


###
# DVERSION - pass module version string
# DDYNAMIC_BMI2 - disable BMI2 amd64 asembler code - can't build it, use CFLAGS with -march= bdver4, znver1/2/3, native
#
COPT = {
'msvc': [ '/Ox', '/DVERSION=%s' % PKG_VERSION_STR, ],
'mingw32': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, ],
'unix': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, ],
'clang': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, ],
'gcc': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, ]
'msvc': [ '/Ox', '/DVERSION=%s' % PKG_VERSION_STR, '/DDYNAMIC_BMI2=0' ],
'mingw32': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=0' ],
'unix': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=0' ],
'clang': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=0' ],
'gcc': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=0' ]
}

if not SUP_EXTERNAL:
Expand Down Expand Up @@ -128,8 +132,13 @@ def build_extensions(self):
'compress/zstd_compress_sequences.c',
'compress/zstd_compress_superblock.c',
'compress/zstdmt_compress.c',
'compress/zstd_fast.c', 'compress/zstd_double_fast.c', 'compress/zstd_lazy.c', 'compress/zstd_opt.c', 'compress/zstd_ldm.c',
'compress/fse_compress.c', 'compress/huf_compress.c',
'compress/zstd_fast.c',
'compress/zstd_double_fast.c',
'compress/zstd_lazy.c',
'compress/zstd_opt.c',
'compress/zstd_ldm.c',
'compress/fse_compress.c',
'compress/huf_compress.c',
'compress/hist.c',

'common/fse_decompress.c',
Expand All @@ -140,7 +149,8 @@ def build_extensions(self):

'common/entropy_common.c',
'common/zstd_common.c',
'common/xxhash.c', 'common/error_private.c',
'common/xxhash.c',
'common/error_private.c',
'common/pool.c',
'common/threading.c',
]:
Expand Down
6 changes: 3 additions & 3 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def raise_skip(msg):

class BaseTestZSTD(unittest.TestCase):

VERSION = "1.5.0"
VERSION_INT = 10500
VERSION = "1.5.1"
VERSION_INT = 10501
VERSION_INT_MIN = 1 * 100*100 + 0 * 1*100 + 0
PKG_VERSION = "1.5.0.4"
PKG_VERSION = "1.5.1.0"

def helper_version(self):
self.assertEqual(self.PKG_VERSION, zstd.version())
Expand Down
2 changes: 1 addition & 1 deletion zstd
Submodule zstd updated 154 files

0 comments on commit 30fccb1

Please sign in to comment.