Coverage for bioimageio/core/utils/__init__.py: 73%
11 statements
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-19 09:02 +0000
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-19 09:02 +0000
1import json
2import sys
3from pathlib import Path
5if sys.version_info < (3, 9):
7 def files(package_name: str):
8 assert package_name == "bioimageio.core"
9 return Path(__file__).parent.parent
11else:
12 from importlib.resources import files as files
15with files("bioimageio.core").joinpath("VERSION").open("r", encoding="utf-8") as f:
16 VERSION = json.load(f)["version"]
17 assert isinstance(VERSION, str)