From 2f060d55e8314a361c363dc7a05bd8c81b694faa Mon Sep 17 00:00:00 2001
From: Danilo Ferreira de Lima <danilo.enoque.ferreira.de.lima@xfel.de>
Date: Fri, 19 Jan 2024 10:02:27 +0100
Subject: [PATCH] Automatically detect version from git tag.

---
 pes_to_spec/__init__.py |  1 -
 pyproject.toml          | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/pes_to_spec/__init__.py b/pes_to_spec/__init__.py
index 937730b..730ad7f 100644
--- a/pes_to_spec/__init__.py
+++ b/pes_to_spec/__init__.py
@@ -2,4 +2,3 @@
 Estimate high-resolution photon spectrometer data from low-resolution non-invasive measurements.
 """
 
-VERSION = "0.3.9"
diff --git a/pyproject.toml b/pyproject.toml
index f96c3a4..d8c3de4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,11 +1,10 @@
 [build-system]
-requires = ["setuptools"]
+requires = ["setuptools", "wheel", "setuptools_scm>=8"]
 build-backend = "setuptools.build_meta"
 
 [project]
 name = "pes_to_spec"
 authors = [
-    {name = "Arman Davtyan", email = "arman.davtyan@xfel.eu"},
     {name = "Danilo Enoque Ferreira de Lima", email = "danilo.enoque.ferreira.de.lima@xfel.eu"},
     {name = "Thomas Michelat", email = "thomas.michelat@xfel.eu"}
     ]
@@ -36,14 +35,15 @@ dependencies = [
 [project.optional-dependencies]
 offline = ["seaborn", "statsmodels", "matplotlib", "extra_data"]
 
-[project.scripts]
-offline_analysis = "pes_to_spec.test.offline_analysis:main"
-
 [tool.setuptools]
-packages = ["pes_to_spec", "pes_to_spec.test"]
+packages = ["pes_to_spec"]
 include-package-data = true
 zip-safe = false
 
 [tool.setuptools.dynamic]
-version = {attr = "pes_to_spec.VERSION"}
 readme = {file = ["README.md"]}
+
+[tool.setuptools-git-versioning]
+enabled = true
+[tool.setuptools_scm]
+version_file = "pes_to_spec/_version.py"
-- 
GitLab