From 256c9445b27f5853b99f17e4089e52aac16447e3 Mon Sep 17 00:00:00 2001 From: Daniel da Silva Date: Sun, 24 Nov 2024 04:07:50 -0500 Subject: [PATCH] Add automatically generated __version__ --- pyproject.toml | 1 + rbinvariantslib/__init__.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 529ade9..f4bdb1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,3 +57,4 @@ Homepage = "https://rbinvariantslib.readthedocs.io/en/latest/" [tool.setuptools_scm] version_scheme = "post-release" local_scheme = "node-and-date" +write_to = "rbinvariants/_version.py" diff --git a/rbinvariantslib/__init__.py b/rbinvariantslib/__init__.py index 8b13789..53fda93 100644 --- a/rbinvariantslib/__init__.py +++ b/rbinvariantslib/__init__.py @@ -1 +1,7 @@ +try: + from ._version import __version__ + from ._version import version_tuple +except ImportError: + __version__ = "unknown" + version_tuple = (0, 0, "unknown version")