From 1f9e3ea481b21428f313dcde643c0097c5152831 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Wed, 25 Sep 2024 17:06:03 -0700 Subject: [PATCH] only pin h5py version on non-mac platforms, since mac seems to be unaffected by file locking problem. fix windows permission error --- pdm.lock | 2 +- pyproject.toml | 3 ++- tests/test_serialization.py | 14 +++----------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/pdm.lock b/pdm.lock index bcaaff7..50e444b 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "arrays", "dask", "dev", "docs", "hdf5", "tests", "video", "zarr"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:a780500141cbf9d8453d464395951aed95cfba9bda9c82012f747c357ae6bb19" +content_hash = "sha256:dee4ba1fabeacedf80f85b145bcb2ef83a2005cac6454f9672eb9a873cadd70b" [[metadata.targets]] requires_python = "~=3.9" diff --git a/pyproject.toml b/pyproject.toml index 9f152fe..a391ef7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,8 @@ dask = [ "dask>=2024.4.0", ] hdf5 = [ - "h5py>=3.10.0,<3.12.0" + "h5py>=3.10.0,<3.12.0;sys_platform!='darwin'", + "h5py>=3.10.0;sys_platform=='darwin'", ] video = [ "opencv-python>=4.9.0.80", diff --git a/tests/test_serialization.py b/tests/test_serialization.py index e1c2cee..efec624 100644 --- a/tests/test_serialization.py +++ b/tests/test_serialization.py @@ -82,17 +82,9 @@ def test_relative_to_root_dir(): beneath the root directory (eg `/data`) even if they exist """ - try: - root = Path().resolve().parents[-1] - except IndexError: - root = Path("/").resolve() - - test_path = None - for path in root.iterdir(): - if path.is_dir(): - test_path = path - - assert test_path is not None + # try: + this_file = Path(__file__).resolve() + test_path = this_file.parents[-2] test_data = {"some_field": str(test_path)}