From 795adac96d6e340045e51b7c52690df248ea93d4 Mon Sep 17 00:00:00 2001 From: Bruce Martin Date: Fri, 24 Feb 2023 10:08:55 -0800 Subject: [PATCH] Python package: update tiledbsoma dep to 1.0.0rc1 (#225) * add test for live directory correctness * upgrade tiledbsoma dependency to 1.0.0rc1 * lint * enable anon bucket access * comments --- api/python/cell_census/pyproject.toml | 2 +- .../cell_census/tests/test_directory.py | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/api/python/cell_census/pyproject.toml b/api/python/cell_census/pyproject.toml index e27aaf9dd..fe204a699 100644 --- a/api/python/cell_census/pyproject.toml +++ b/api/python/cell_census/pyproject.toml @@ -35,7 +35,7 @@ dependencies= [ # of TileDB on-disk storage format. Make sure this doesn't fall behind the builder's tiledbsoma version. # NOTE: tiledb is also a requirement of the API, but tiledbsoma also has a tiledb dependency, so just use # the same version here - "tiledbsoma==1.0rc0", + "tiledbsoma==1.0.0rc1", "typing_extensions", "s3fs", "scikit-misc", diff --git a/api/python/cell_census/tests/test_directory.py b/api/python/cell_census/tests/test_directory.py index 5d7c1579b..419fc488c 100644 --- a/api/python/cell_census/tests/test_directory.py +++ b/api/python/cell_census/tests/test_directory.py @@ -2,6 +2,7 @@ import pytest import requests_mock as rm +import s3fs import cell_census from cell_census._release_directory import CELL_CENSUS_RELEASE_DIRECTORY_URL @@ -57,3 +58,24 @@ def test_get_census_version_directory(directory_mock: Any) -> None: for tag in directory: assert directory[tag] == cell_census.get_census_version_description(tag) + + +@pytest.mark.live_corpus +def test_live_directory_contents() -> None: + # Sanity check that all directory contents are usable. This uses the + # live directory, so it _could_ start failing without a code change. + # But given the purpose of this package, that seems like a reasonable + # tradeoff, as the data directory should never be "corrupt" or there + # is widespread impact on users. + + fs = s3fs.S3FileSystem(anon=True, cache_regions=True) + + directory = cell_census.get_census_version_directory() + assert "latest" in directory + + for version, version_description in directory.items(): + with cell_census.open_soma(census_version=version) as census: + assert census is not None + + assert fs.exists(version_description["soma"]["uri"]) + assert fs.exists(version_description["h5ads"]["uri"])