From f1a68de34f2ffa3857c7916ec28863e9962c5a4d Mon Sep 17 00:00:00 2001 From: "Wesley M. Gifford" Date: Tue, 28 May 2024 14:11:28 -0400 Subject: [PATCH 1/2] versions --- .gitignore | 5 ++++- pyproject.toml | 8 ++++++-- tsfm_public/__init__.py | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) 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__ From 2958fd9ab989aea0dc0ad11e05170675e6525239 Mon Sep 17 00:00:00 2001 From: "Wesley M. Gifford" Date: Tue, 28 May 2024 14:32:30 -0400 Subject: [PATCH 2/2] add missing file --- tsfm_public/version.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tsfm_public/version.py diff --git a/tsfm_public/version.py b/tsfm_public/version.py new file mode 100644 index 00000000..ee6e7ead --- /dev/null +++ b/tsfm_public/version.py @@ -0,0 +1,9 @@ +# Copyright contributors to the TSFM project +# + +try: + # Local + from ._version import __version__, __version_tuple__ # noqa: F401 # unused import +except ImportError: + __version__ = "unknown" + version_tuple = (0, 0, __version__)