diff --git a/pyproject.toml b/pyproject.toml index 1238675..4ee76a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [build-system] -requires = ["setuptools>=61"] +requires = ["setuptools>=61", "setuptools_scm[toml]>=7"] build-backend = "setuptools.build_meta" [project] name = "cloudcasting" -version = "0.3.0" +dynamic = ["version"] authors = [ { name = "cloudcasting Maintainers", email = "nsimpson@turing.ac.uk" }, ] @@ -60,6 +60,9 @@ dev = [ [tool.setuptools.package-data] "cloudcasting" = ["data/*.zip"] +[tool.setuptools_scm] +write_to = "src/cloudcasting/_version.py" + [project.scripts] cloudcasting = "cloudcasting.cli:app" diff --git a/src/cloudcasting/__init__.py b/src/cloudcasting/__init__.py index 73e6bbf..785e2f3 100644 --- a/src/cloudcasting/__init__.py +++ b/src/cloudcasting/__init__.py @@ -4,8 +4,6 @@ from __future__ import annotations -from importlib.metadata import version - from jaxtyping import install_import_hook # Any module imported inside this `with` block, whose @@ -19,6 +17,8 @@ from cloudcasting import cli, dataset, download, metrics +from ._version import version as __version__ + __all__ = ( "__version__", "download", @@ -28,4 +28,3 @@ "validation", "metrics", ) -__version__ = version(__name__) diff --git a/src/cloudcasting/_version.pyi b/src/cloudcasting/_version.pyi new file mode 100644 index 0000000..c2ee2ca --- /dev/null +++ b/src/cloudcasting/_version.pyi @@ -0,0 +1 @@ +version: str