|
34 | 34 | from typing import Any, cast |
35 | 35 |
|
36 | 36 | import numpy |
37 | | -from packaging.version import parse as parse_version |
38 | 37 |
|
39 | 38 | import h5py |
40 | 39 | import hdf5plugin |
@@ -435,8 +434,8 @@ def setUp(self): |
435 | 434 | numpy.array(["test", "strings", "ascii"] * N, dtype="S"), |
436 | 435 | numpy.array([b"test", b"strings", b"binary"] * N, dtype="O"), |
437 | 436 | ] |
438 | | - has_h5py_314 = parse_version(h5py.__version__) >= parse_version("3.14") |
439 | | - has_numpy_2 = parse_version(numpy.__version__) >= parse_version("2.0") |
| 437 | + has_h5py_314 = h5py.version.version_tuple >= (3, 14) |
| 438 | + has_numpy_2 = numpy.__version__.startswith("2.") |
440 | 439 | if has_h5py_314 and has_numpy_2: |
441 | 440 | self.string_arrays.append( |
442 | 441 | numpy.array(["test", "strings", "Crème brûlée"] * N, dtype="T") |
@@ -494,13 +493,17 @@ def _test_strings( |
494 | 493 | self.assertEqual(len(filters), 1) |
495 | 494 | self.assertEqual(filters[0][0], hdf5plugin.FILTERS[filter_name]) |
496 | 495 |
|
497 | | - @unittest.skip(reason="segfault (#364)") |
| 496 | + @unittest.skipIf( |
| 497 | + h5py.version.hdf5_version_tuple < (2, 1, 0), "hdf5 v2.1.0 required" |
| 498 | + ) |
498 | 499 | @unittest.skipUnless(should_test("blosc"), "Blosc filter not available") |
499 | 500 | def testStringsBlosc(self): |
500 | 501 | """Strings write/read test with blosc filter plugin""" |
501 | 502 | self._test_strings("blosc") # Default options |
502 | 503 |
|
503 | | - @unittest.skip(reason="segfault (#364)") |
| 504 | + @unittest.skipIf( |
| 505 | + h5py.version.hdf5_version_tuple < (2, 1, 0), "hdf5 v2.1.0 required" |
| 506 | + ) |
504 | 507 | @unittest.skipUnless(should_test("blosc2"), "Blosc filter not available") |
505 | 508 | def testStringsBlosc2(self): |
506 | 509 | """Strings write/read test with blosc2 filter plugin""" |
|
0 commit comments