diff --git a/.travis.yml b/.travis.yml index f85ca67a..8667a3f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,18 @@ git: matrix: include: + - python: 2.7 + os: linux + env: BUILD_COMMAND=sdist + + - python: 3.4 + os: linux + env: BUILD_COMMAND=sdist + + - python: 3.5 + os: linux + env: BUILD_COMMAND=sdist + - language: generic os: osx env: BUILD_COMMAND=bdist_wheel diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cc27e7a4..48231a14 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,13 @@ +1.3.0 +----- + +- Add 64-bit manylinux version LZ4 filter plugin + +- Add 64-bit manylinux version bitshuffle plugin + +- Implement continuous imtegration testing + + 1.2.0 ----- diff --git a/README.rst b/README.rst index 7da2b417..a1239b7a 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ hdf5plugin This module provides HDF5 plugins and sets the HDF5_PLUGIN_PATH to the appropriate value according to the version of python used. -The module is mainly intended for use under windows but shared libraries for MacOS are also provided. +The module is mainly intended for use under windows but shared libraries for MacOS and manylinux are also provided. The LZ4 plugin sources were obtained from https://github.com/nexusformat/HDF5-External-Filter-Plugins @@ -12,7 +12,7 @@ The bitshuffle plugin sources were obtained from https://github.com/kiyo-masui/b Known issues ------------ -Under MacOS, the bitshuffle plugin is limited to decompression (i.e. it can be used to read bitshuffle compressed data). +Under MacOS and linux, the bitshuffle plugin is limited to decompression (i.e. it can be used to read bitshuffle compressed data). Installation diff --git a/hdf5plugin/__init__.py b/hdf5plugin/__init__.py index 1eaaa964..d0570577 100644 --- a/hdf5plugin/__init__.py +++ b/hdf5plugin/__init__.py @@ -32,9 +32,21 @@ import os import sys + if sys.platform.startswith("darwin"): compiler = "darwin" arch = None + path_separator = ":" +elif sys.platform.startswith("linux"): + if sys.maxsize > 2**32: + # 64 bit + arch = "x86_64" + compiler = "manylinux" + else: + # 32 bit + arch = None + compiler = None + path_separator = ":" elif sys.platform.startswith("win"): if sys.version.startswith("3.5"): compiler = "VS2015" @@ -48,6 +60,7 @@ else: # 32 bit arch = "x86" + path_separator = ";" else: compiler = None @@ -64,5 +77,4 @@ if current_path is None: os.environ["HDF5_PLUGIN_PATH"] = plugin_path else: - os.environ["HDF5_PLUGIN_PATH"] = current_path + ";" + plugin_path - + os.environ["HDF5_PLUGIN_PATH"] = current_path + path_separator + plugin_path diff --git a/hdf5plugin/manylinux/x86_64/libH5Zlz4.so b/hdf5plugin/manylinux/x86_64/libH5Zlz4.so new file mode 100755 index 00000000..72eb2e3d Binary files /dev/null and b/hdf5plugin/manylinux/x86_64/libH5Zlz4.so differ diff --git a/hdf5plugin/manylinux/x86_64/libH5bshuf.so b/hdf5plugin/manylinux/x86_64/libH5bshuf.so new file mode 100755 index 00000000..f4cfde88 Binary files /dev/null and b/hdf5plugin/manylinux/x86_64/libH5bshuf.so differ diff --git a/setup.py b/setup.py index 9eb7f123..07521f7b 100644 --- a/setup.py +++ b/setup.py @@ -24,14 +24,14 @@ # ###########################################################################*/ __authors__ = ["V.A. Sole"] __license__ = "MIT" -__date__ = "25/08/2016" +__date__ = "30/11/2016" from setuptools import setup -version="1.2.0" +version="1.3.0" name = "hdf5plugin" author = "ESRF - Data Analysis Unit" -description = "HDF5 Plugins for windows (and MacOS)" +description = "HDF5 Plugins for windows,MacOS and linux" f = open("README.rst") long_description=f.read() f.close() @@ -43,6 +43,7 @@ "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", + "Operating System :: POSIX :: Linux", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Programming Language :: Python :: 2.7", @@ -53,7 +54,8 @@ ] package_data = {'hdf5plugin': ["VS2008/x86/*" ,"VS2008/x64/*", "VS2015/x86/*", "VS2015/x64/*", - "darwin/*"]} + "darwin/*", + "manylinux/x86_64/*"]} if __name__ == "__main__": setup(name=name, diff --git a/test/test.py b/test/test.py index 1aa18957..afa1f6a4 100644 --- a/test/test.py +++ b/test/test.py @@ -29,12 +29,14 @@ import os import sys import unittest +from distutils.version import LooseVersion class TestHDF5Plugin(unittest.TestCase): def setUp(self): if "hdf5plugin" not in sys.modules: self.assertFalse("h5py" in sys.modules) import hdf5plugin + def tearDown(self): pass @@ -45,6 +47,9 @@ def testHDF5PluginImport(self): def testLZ4(self): import h5py + version = h5py.version.hdf5_version + if LooseVersion(version) < LooseVersion("1.8.11"): + self.skipTest("HDF5 %s Version is lower than 1.8.11" % version) dirname = os.path.abspath(os.path.dirname(__file__)) fname = os.path.join(dirname, "lz4.h5") self.assertTrue(os.path.exists(fname), @@ -60,6 +65,9 @@ def testLZ4(self): def testBitshuffle(self): import h5py + version = h5py.version.hdf5_version + if LooseVersion(version) < LooseVersion("1.8.11"): + self.skipTest("HDF5 %s Version is lower than 1.8.11" % version) dirname = os.path.abspath(os.path.dirname(__file__)) fname = os.path.join(dirname, "bitshuffle.h5") self.assertTrue(os.path.exists(fname), @@ -86,7 +94,12 @@ def getSuite(auto=True): return testSuite def test(auto=False): - unittest.TextTestRunner(verbosity=2).run(getSuite(auto=auto)) + result = unittest.TextTestRunner(verbosity=2).run(getSuite(auto=auto)) + return(result) if __name__ == "__main__": - test() + result = test() + if result.wasSuccessful(): + sys.exit(0) + else: + sys.exit(1)