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
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
language: python

sudo: false

addons:
apt:
packages:
- liblzma-dev

python:
- 2.7
- 3.4
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ envlist = py27, py34, py35, py36, docs
setenv =
PYTHONHASHSEED = 42
commands =
py27: pip install -U backports.lzma
python setup.py build_ext --inplace
py27,py34,py35: nosetests -v --with-coverage --cover-erase --cover-package=zarr zarr
py36: nosetests -v --with-coverage --cover-erase --cover-package=zarr --with-doctest --doctest-options=+NORMALIZE_WHITESPACE zarr
Expand Down
9 changes: 7 additions & 2 deletions zarr/codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,16 @@ def __repr__(self):
codec_registry[BZ2.codec_id] = BZ2


lzma = None
try:
import lzma
except ImportError: # pragma: no cover
pass
else:
try:
from backports import lzma
except ImportError:
pass

if lzma:

# noinspection PyShadowingBuiltins
class LZMA(Codec):
Expand Down
9 changes: 7 additions & 2 deletions zarr/tests/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,16 @@ def test_decode(self):
self._test_decode_lossless(arr, **config)


lzma = None
try:
import lzma
except ImportError: # pragma: no cover
pass
else:
try:
from backports import lzma
except ImportError:
pass

if lzma:

class TestLZMA(CodecTests, unittest.TestCase):

Expand Down