@@ 13,13 13,17 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import shutil
+import subprocess
+
+
+from datetime import datetime
from setuptools import setup
with open("README.md", "r") as r:
long_desc = r.read()
-
with open("requirements.txt", "r") as f:
_req = f.readlines()
@@ 27,9 31,36 @@ req = []
for r in _req:
req.append(r.strip("\n"))
+git = shutil.which("git")
+
+if git:
+ exact_tag = subprocess.run(
+ ["git", "describe", "--exact-match", "--tags", "HEAD"],
+ stderr=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ )
+
+ err = exact_tag.stderr.decode()
+ if not err:
+ ver = exact_tag.stdout.decode().strip("\n")
+
+ not_tag = subprocess.run(
+ ["git", "describe", "--tags"], stderr=subprocess.PIPE, stdout=subprocess.PIPE
+ )
+
+ err2 = not_tag.stderr.decode()
+ if not err2:
+ ver = not_tag.stdout.decode().strip("\n")
+
+else:
+ fmt = "%Y%m%d%H%M%S"
+ now = datetime.now()
+ ver = now.strftime(fmt)
+
+
setup(
name="MousikoFidi",
- version="0.16",
+ version=ver,
author="Hristos N. Triantafillou",
author_email="me@hristos.co",
description="MousikóFídi: Your Music Cloud",