Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions blosc/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import gc
import os
from ._version import LooseVersion
import _version
import ctypes
import blosc
import unittest
Expand Down Expand Up @@ -52,7 +52,7 @@ def test_all_filters(self):
s = b'0123456789'*100
filters = [blosc.NOSHUFFLE, blosc.SHUFFLE]
# BITFILTER only works properly from 1.8.0 on
if LooseVersion(blosc.blosclib_version) >= LooseVersion("1.8.0"):
if _version.LooseVersion(blosc.blosclib_version) >= _version.LooseVersion("1.8.0"):
filters.append(blosc.BITSHUFFLE)
for filter_ in filters:
c = blosc.compress(s, typesize=1, shuffle=filter_)
Expand Down
4 changes: 2 additions & 2 deletions blosc/toplevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import os
import sys
from ._version import LooseVersion
import _version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't going to work when the package is installed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to fix tests? It might be preferable to switch to packages as suggested by PEP 632.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that be OK?

from blosc._version import LooseVersion

try:
import cPickle as pickle
except ImportError:
Expand Down Expand Up @@ -344,7 +344,7 @@ def _check_shuffle(shuffle):
raise ValueError("shuffle can only be one of NOSHUFFLE, SHUFFLE"
" and BITSHUFFLE.")
if (shuffle == blosc.BITSHUFFLE and
LooseVersion(blosc.blosclib_version) < LooseVersion("1.8.0")):
_version.LooseVersion(blosc.blosclib_version) < _version.LooseVersion("1.8.0")):
raise ValueError("You need C-Blosc 1.8.0 or higher for using"
" BITSHUFFLE.")

Expand Down