Skip to content

Commit

Permalink
Merge pull request #35 from sergey-dryabzhinsky/update-1.3.8
Browse files Browse the repository at this point in the history
Update to zstd-1.3.8
  • Loading branch information
sergey-dryabzhinsky authored Dec 30, 2018
2 parents cbdfbe2 + 57f6c56 commit f4357da
Show file tree
Hide file tree
Showing 7 changed files with 36 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.3.5.1
Version: 1.3.8.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.3.5.1.tar.gz
Download-URL: https://github.com/sergey-dryabzhinsky/python-zstd/archive/v1.3.8.0.tar.gz
Description: Simple ZSTandarD bindings for Python
Keywords: zstd,zstandard,compression
Platform: POSIX
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ Module has simple API:
>>> dir(zstd)
['Error', 'ZSTD_compress', 'ZSTD_uncompress', 'ZSTD_version', 'ZSTD_version_number', '__doc__', '__file__', '__name__', '__package__', 'compress', 'decompress', 'dumps', 'loads', 'uncompress', 'version']
>>> zstd.version()
'1.3.4.1'
'1.3.8.0'
>>> zstd.ZSTD_version()
'1.3.4'
'1.3.8'
>>> zstd.ZSTD_version_number()
10304
10308
>>> data = "123456qwert"
>>> cdata = zstd.compress(data, 1)
>>> data == zstd.decompress(cdata)
Expand Down
28 changes: 17 additions & 11 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, 3, 5,)
VERSION = (1, 3, 8,)
VERSION_STR = ".".join([str(x) for x in VERSION])

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

###
Expand Down Expand Up @@ -61,21 +61,21 @@


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, ],
'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, ]
}

if not SUP_EXTERNAL:
for comp in COPT:
if comp == 'msvc':
COPT[comp].extend([
COPT[comp].extend([ '/DZSTD_MULTITHREAD=1',
'/Izstd\\lib', '/Izstd\\lib\\common', '/Izstd\\lib\\compress', '/Izstd\\lib\\decompress',
])
else:
COPT[comp].extend([
COPT[comp].extend([ '-DZSTD_MULTITHREAD=1',
'-Izstd/lib', '-Izstd/lib/common', '-Izstd/lib/compress', '-Izstd/lib/decompress',
])

Expand Down Expand Up @@ -113,9 +113,15 @@ def build_extensions(self):
'compress/fse_compress.c', 'compress/huf_compress.c',
'compress/hist.c',

'decompress/zstd_decompress.c', 'common/fse_decompress.c', 'decompress/huf_decompress.c',
'common/fse_decompress.c',
'decompress/zstd_decompress.c',
'decompress/zstd_decompress_block.c',
'decompress/zstd_ddict.c',
'decompress/huf_decompress.c',

'common/entropy_common.c', 'common/zstd_common.c', 'common/xxhash.c', 'common/error_private.c', 'common/pool.c',
'common/entropy_common.c', 'common/zstd_common.c', 'common/xxhash.c', 'common/error_private.c',
'common/pool.c',
'common/threading.c',
]:
zstdFiles.append('zstd/lib/'+f)

Expand Down
6 changes: 3 additions & 3 deletions src/python-zstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static PyObject *py_zstd_uncompress(PyObject* self, PyObject *args)
/**
* Returns this module version as string
*/
static PyObject *py_zstd_module_version(PyObject* self)
static PyObject *py_zstd_module_version(PyObject* self, PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromFormat("%s", VERSION);
Expand All @@ -164,7 +164,7 @@ static PyObject *py_zstd_module_version(PyObject* self)
/**
* Returns ZSTD library version as string
*/
static PyObject *py_zstd_library_version(PyObject* self)
static PyObject *py_zstd_library_version(PyObject* self, PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromFormat("%s", ZSTD_versionString());
Expand All @@ -176,7 +176,7 @@ static PyObject *py_zstd_library_version(PyObject* self)
/**
* Returns ZSTD library version as int (major * 100*100 + minor * 100 + release)
*/
static PyObject *py_zstd_library_version_int(PyObject* self)
static PyObject *py_zstd_library_version_int(PyObject* self, PyObject *args)
{
return Py_BuildValue("i", ZSTD_VERSION_NUMBER);
}
Expand Down
6 changes: 3 additions & 3 deletions src/python-zstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ static PyObject *ZstdError;

static PyObject *py_zstd_compress(PyObject* self, PyObject *args);
static PyObject *py_zstd_uncompress(PyObject* self, PyObject *args);
static PyObject *py_zstd_module_version(PyObject* self);
static PyObject *py_zstd_library_version(PyObject* self);
static PyObject *py_zstd_library_version_int(PyObject* self);
static PyObject *py_zstd_module_version(PyObject* self, PyObject *args);
static PyObject *py_zstd_library_version(PyObject* self, PyObject *args);
static PyObject *py_zstd_library_version_int(PyObject* self, PyObject *args);

#if PYZSTD_LEGACY > 0
static PyObject *py_zstd_compress_old(PyObject* self, PyObject *args);
Expand Down
7 changes: 7 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# Tests

import sys

# Another dirty hack for tests
if sys.hexversion < 0x03000000:
import test_compress
import test_version
2 changes: 1 addition & 1 deletion zstd
Submodule zstd updated 227 files

0 comments on commit f4357da

Please sign in to comment.