def version(astype=None, _versions_=[]): """Return detailed version information about test dependencies.""" if not _versions_: _versions_.extend(( ('imagecodecs.py', __version__), ('numpy', numpy.__version__), ('zlib', zlib.ZLIB_VERSION), ('bz2', 'stdlib'), ('lzma', getattr(lzma, '__version__', 'stdlib')), ('blosc', blosc.__version__ if blosc else 'n/a'), ('zstd', zstd.version() if zstd else 'n/a'), ('lz4', lz4.VERSION if lz4 else 'n/a'), ('lzf', 'unknown' if lzf else 'n/a'), ('snappy', 'unknown' if snappy else 'n/a'), ('zopflipy', zopfli.__version__ if zopfli else 'n/a'), ('zfpy', zfp.__version__ if zfp else 'n/a'), ('bitshuffle', bitshuffle.__version__ if bitshuffle else 'n/a'), ('pillow', pillow.__version__ if pillow else 'n/a'), ('tifffile', tifffile.__version__ if tifffile else 'n/a'), ('czifile', czifile.__version__ if czifile else 'n/a'), )) if astype is str or astype is None: return ', '.join(f'{k}-{v}' for k, v in _versions_) if astype is dict: return dict(_versions_) return tuple(_versions_)
def helper_zstd_version_number(self): if self.ZSTD_EXTERNAL: # Python 2.6 unittest missing assertLessEqual self.failIf( self.VERSION_INT_MIN > zstd.ZSTD_version_number(), msg="PyZstd %s require external library version >= 1.0.0!" % zstd.version()) else: self.assertEqual(self.VERSION_INT, zstd.ZSTD_version_number())
def version(astype=None): """Return detailed version information.""" versions = ( ('imagecodecs', __version__), ('numpy', numpy.__version__), ('zlib', zlib.ZLIB_VERSION), ('bz2', 'stdlib' if bz2 else 'n/a'), ('lzma', getattr(lzma, '__version__', 'stdlib') if lzma else 'n/a'), ('blosc', blosc.__version__ if blosc else 'n/a'), ('zstd', zstd.version() if zstd else 'n/a'), ('lz4', lz4.VERSION if lz4 else 'n/a'), ('lzf', 'unknown' if lzf else 'n/a'), ('pil', PIL.PILLOW_VERSION if PIL else 'n/a'), ) if astype is str or astype is None: return ', '.join('%s-%s' % (k, v) for k, v in versions) if astype is dict: return dict(versions) return versions
def helper_version(self): self.assertEqual(self.PKG_VERSION, zstd.version())
def helper_zstd_version_number_min(self): self.assertFalse( self.VERSION_INT_MIN > zstd.ZSTD_version_number(), msg="PyZstd %s require external library version >= 1.0.0!" % zstd.version())