Skip to content

Commit 68b47b1

Browse files
authored
Update version import method for anndata package (#70)
* Update version import method for anndata package
1 parent 621eba5 commit 68b47b1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/treedata/_core/read.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import warnings
55
from collections.abc import MutableMapping
6+
from importlib.metadata import version as get_version
67
from typing import TYPE_CHECKING, Literal
78

89
import anndata as ad
@@ -16,8 +17,8 @@
1617
if TYPE_CHECKING:
1718
from os import PathLike
1819

19-
ANDATA_VERSION = version.parse(ad.__version__)
20-
USE_EXPERIMENTAL = ANDATA_VERSION < version.parse("0.11.0")
20+
ANNDATA_VERSION = version.parse(get_version("anndata"))
21+
USE_EXPERIMENTAL = ANNDATA_VERSION < version.parse("0.11.0")
2122

2223

2324
def _read_elem(elem):

0 commit comments

Comments
 (0)