From 54e81f45e314d6b071e16cdd7cc23870efe1ac0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9gis=20Behmo?= <regis@behmo.com>
Date: Mon, 20 Nov 2023 17:39:47 +0100
Subject: [PATCH] feat: simplify nightly version management

By pulling the version suffix from tutor, we avoid git conflicts when
merging the release branch in nightly.
---
 setup.py              | 2 +-
 tutormfe/__about__.py | 7 -------
 tutormfe/plugin.py    | 7 ++++++-
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/setup.py b/setup.py
index b9b645f1..c3607674 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ def load_about():
 
 setup(
     name="tutor-mfe",
-    version=ABOUT["__package_version__"],
+    version=ABOUT["__version__"],
     url="https://github.com/overhangio/tutor-mfe",
     project_urls={
         "Code": "https://github.com/overhangio/tutor-mfe",
diff --git a/tutormfe/__about__.py b/tutormfe/__about__.py
index a0baa1a1..fc0415ae 100644
--- a/tutormfe/__about__.py
+++ b/tutormfe/__about__.py
@@ -1,9 +1,2 @@
 __version__ = "16.1.2"
-__package_version__ = __version__
 
-
-# Handle version suffix for nightly, just like tutor core.
-__version_suffix__ = ""
-
-if __version_suffix__:
-    __version__ += "-" + __version_suffix__
diff --git a/tutormfe/plugin.py b/tutormfe/plugin.py
index 4ab28602..1a1fa5ff 100644
--- a/tutormfe/plugin.py
+++ b/tutormfe/plugin.py
@@ -6,13 +6,18 @@
 
 import pkg_resources
 from tutor import fmt
+from tutor.__about__ import __version_suffix__
 from tutor import hooks as tutor_hooks
 from tutor.hooks import priorities
 from tutor.types import Config, get_typed
 
-from .__about__ import __version__, __version_suffix__
+from .__about__ import __version__
 from .hooks import MFE_APPS, MFE_ATTRS_TYPE
 
+# Handle version suffix in nightly mode, just like tutor core
+if __version_suffix__:
+    __version__ += "-" + __version_suffix__
+
 config = {
     "defaults": {
         "VERSION": __version__,