diff --git a/goat_monitor/_version.py b/goat_monitor/_version.py new file mode 100644 index 0000000..da94e81 --- /dev/null +++ b/goat_monitor/_version.py @@ -0,0 +1 @@ +__version__ = "editable" diff --git a/goat_monitor/goat_monitor.py b/goat_monitor/goat_monitor.py index 0222d48..d30c689 100644 --- a/goat_monitor/goat_monitor.py +++ b/goat_monitor/goat_monitor.py @@ -9,7 +9,7 @@ import gotify import numpy as np import toml -from goat_monitor import __version__ +from goat_monitor._version import __version__ # %% commands @@ -37,7 +37,7 @@ def wrap(command: List[str], config: Path, retries: int, version): """Wrap an arbitrary command with gotify notifications""" if version: - print(version) + print(__version__) sys.exit(0) # read settings first diff --git a/pyproject.toml b/pyproject.toml index ed35fd5..0ac5b29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,8 @@ homepage = "https://git.brendanhaines.com/brendanhaines/goat_monitor" [project.scripts] goat_monitor = "goat_monitor.goat_monitor:main" +[tool.setuptools_scm] +version_file = "goat_monitor/_version.py" [tool.black] line-length = 120