diff --git a/.gitignore b/.gitignore index 7fe0f2f8..78139166 100644 --- a/.gitignore +++ b/.gitignore @@ -136,4 +136,7 @@ notebooks/thinklab/checkpoint/** /tsfmhfdemos/neurips/models/ # Checkpoints -*.checkpoint-*/ \ No newline at end of file +*.checkpoint-*/ + +# Version +/tsfm_public/_version.py \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 51acb09f..1d956be9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,11 @@ [build-system] -requires = ["setuptools>=66", "wheel", "Cython"] +requires = ["setuptools>=66", "wheel", "Cython", "setuptools-scm>=8.0"] [project] name = "tsfm_public" requires-python = ">=3.9,<3.12" -version = "0.0.1" +# version = "0.0.1" +dynamic = ["version"] authors = [{ name = "IBM" }] description = "Public notebooks and utilities for TSFM" readme = "README.md" @@ -45,6 +46,9 @@ demos = [ # ################################################### +[tool.setuptools_scm] +version_file = "tsfm_public/_version.py" + [tool.ruff] # Never enforce `E501` (line length violations). ignore = ["C901", "E501", "E741", "F402", "F823" ] diff --git a/tsfm_public/__init__.py b/tsfm_public/__init__.py index 4f85bd0b..51ab4da0 100644 --- a/tsfm_public/__init__.py +++ b/tsfm_public/__init__.py @@ -1,2 +1,4 @@ # Copyright contributors to the TSFM project # + +from .version import __version__, __version_tuple__