Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fc0d81d
Update to upstream lz4 r130
jonathanunderwood Jun 27, 2015
a7316f7
Export the new compress_fast method
jonathanunderwood Jun 27, 2015
d4fc5f7
Update version to 0.8.0
jonathanunderwood Jun 27, 2015
1147197
Add logic for building against a system lz4 library to setup.py
jonathanunderwood Jun 28, 2015
ed10272
Only add the LZ4_VERSION string to the module if building against bun…
jonathanunderwood Jun 28, 2015
7eaffaf
Add lz4version function to return the lz4 C library version
jonathanunderwood Jun 28, 2015
8423381
Move requires for nose from setup_requires to tests_requires
jonathanunderwood Jul 1, 2015
b95160b
Include tests/*.py in source distribution
jonathanunderwood Jul 1, 2015
7f01b8b
Fix compilation for vs2008
keeely Oct 30, 2015
60f22ad
Avoid directly including stdint.h
keeely Oct 30, 2015
ff4754c
release the GIL while compressing and decompressing
jennolsen84 Jan 6, 2016
f36c54c
Test 3.4 and 3.5 on travis.ci
mrocklin Mar 1, 2016
8156a5e
add license file
mrocklin Mar 1, 2016
e11e751
test threads
mrocklin Mar 1, 2016
e7ff5c4
Merge remote-tracking branch 'origin/unbundle'
jonathanunderwood Mar 2, 2016
9634f11
Merge remote-tracking branch 'mrocklin/nogil'
jonathanunderwood Mar 2, 2016
cb273e8
Merge remote-tracking branch 'mrocklin/travis'
jonathanunderwood Mar 2, 2016
e820245
Merge remote-tracking branch 'mrocklin/license'
jonathanunderwood Mar 2, 2016
ff465e6
Merge remote-tracking branch 'keeely/master'
jonathanunderwood Mar 2, 2016
5a78877
Add PyPi classifiers for Python 3.4 and 3.5
jonathanunderwood Mar 2, 2016
10e9f53
Update lz4 files to r131
jonathanunderwood Mar 2, 2016
d30f96a
Update LZ4_VERSION to r131
jonathanunderwood Mar 2, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ python:
- 2.7
- 3.2
- 3.3
install:
- 3.4
- 3.5
install:
script: python setup.py test
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright (c) 2012-2013, Steeve Morin
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of Steeve Morin nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
include README.rst
include src/*.h
include tests/*.py
exclude tests/*.pyc
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The bindings provides some aliases too::
True
>>> lz4.LZ4_uncompress == lz4.uncompress == z4.decompress == lz4.loads
True
>>> lz4.VERSION == lz4.__version__ # e.g. "0.7.0"
>>> lz4.VERSION == lz4.__version__ # e.g. "0.8.0"
True
>>>

Expand Down
76 changes: 59 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,63 @@


from setuptools import setup, find_packages, Extension
import subprocess
import os
from distutils import ccompiler

VERSION = (0, 7, 0)
VERSION = (0, 8, 0)
VERSION_STR = ".".join([str(x) for x in VERSION])
LZ4_VERSION = "r131"

# Check to see if we have a lz4 library installed on the system and
# use it if so. If not, we'll use the bundled library. If lz4 is
# installed it will have a pkg-config file, so we'll use pkg-config to
# check for existence of the library.
pkg_config_exe = os.environ.get('PKG_CONFIG', None) or 'pkg-config'
cmd = '{0} --exists liblz4'.format(pkg_config_exe).split()
liblz4_found = subprocess.call(cmd) == 0

if liblz4_found:
# Use system lz4, and don't set optimization and warning flags for
# the compiler. Specifically we don't define LZ4_VERSION since the
# system lz4 library could be updated (that's the point of a
# shared library).
if ccompiler.get_default_compiler() == "msvc":
extra_compile_args = ["/Ot", "/Wall"]
define_macros = [("VERSION","\\\"%s\\\"" % VERSION_STR),]
else:
extra_compile_args = ["-std=c99",]
define_macros = [("VERSION","\"%s\"" % VERSION_STR),]

lz4mod = Extension('lz4',
[
'src/python-lz4.c'
],
extra_compile_args=extra_compile_args,
define_macros=define_macros,
libraries=['lz4'],
)
else:
# Use the bundled lz4 libs, and set the compiler flags as they
# historically have been set. We do set LZ4_VERSION here, since it
# won't change after compilation.
if ccompiler.get_default_compiler() == "msvc":
extra_compile_args = ["/Ot", "/Wall"]
define_macros = [("VERSION","\\\"%s\\\"" % VERSION_STR), ("LZ4_VERSION","\\\"%s\\\"" % LZ4_VERSION)]
else:
extra_compile_args = ["-std=c99","-O3","-Wall","-W","-Wundef"]
define_macros = [("VERSION","\"%s\"" % VERSION_STR), ("LZ4_VERSION","\"%s\"" % LZ4_VERSION)]

lz4mod = Extension('lz4',
[
'src/lz4.c',
'src/lz4hc.c',
'src/python-lz4.c'
],
extra_compile_args=extra_compile_args,
define_macros=define_macros,
)


setup(
name='lz4',
Expand All @@ -16,22 +70,8 @@
url='https://github.com/steeve/python-lz4',
packages=find_packages('src'),
package_dir={'': 'src'},
ext_modules=[
Extension('lz4', [
'src/lz4.c',
'src/lz4hc.c',
'src/python-lz4.c'
], extra_compile_args=[
"-std=c99",
"-O3",
"-Wall",
"-W",
"-Wundef",
"-DVERSION=\"%s\"" % VERSION_STR,
"-DLZ4_VERSION=\"r119\"",
])
],
setup_requires=["nose>=1.0"],
ext_modules=[lz4mod,],
tests_require=["nose>=1.0"],
test_suite = "nose.collector",
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand All @@ -42,5 +82,7 @@
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
)
Loading