diff --git a/pyproject.toml b/pyproject.toml index 590f121..5135987 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling"] +requires = ["hatchling", "versioningit"] build-backend = "hatchling.build" [project] @@ -30,7 +30,7 @@ dependencies = [ ] [tool.hatch.version] -path = "src/lazyslide/__init__.py" +source = "versioningit" [tool.hatch.build.targets.wheel] packages = ["src/lazyslide", "src/lazyslide_cv", "src/wsi_data"] diff --git a/src/lazyslide/__init__.py b/src/lazyslide/__init__.py index 67c6e84..c943960 100644 --- a/src/lazyslide/__init__.py +++ b/src/lazyslide/__init__.py @@ -1,4 +1,8 @@ +import pkg_resources + from wsi_data import open_wsi import lazyslide.pp as pp import lazyslide.tl as tl import lazyslide.pl as pl + +version = __version__ = pkg_resources.get_distribution("lazyslide").version