From 0500bfe9a6649a5a251f8bc3018448b214706a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Thu, 31 Mar 2022 15:36:30 +0200 Subject: [PATCH] fix: package version in nightly The string returned by "make version" should not include the "-nightly" suffix, otherwise tests fail. --- Makefile | 2 +- setup.py | 2 +- tutor/__about__.py | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2eb30e8..9cbbc4c 100644 --- a/Makefile +++ b/Makefile @@ -123,7 +123,7 @@ ci-bootstrap-images: ###### Additional commands version: ## Print the current tutor version - @python -c 'import io, os; about = {}; exec(io.open(os.path.join("tutor", "__about__.py"), "rt", encoding="utf-8").read(), about); print(about["__version__"])' + @python -c 'import io, os; about = {}; exec(io.open(os.path.join("tutor", "__about__.py"), "rt", encoding="utf-8").read(), about); print(about["__package_version__"])' ESCAPE =  help: ## Print this help diff --git a/setup.py b/setup.py index ac143bd..8debb23 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ ABOUT = load_about() setup( name="tutor", - version=ABOUT["__version__"].split("-")[0], # drop "-nightly" suffix if present + version=ABOUT["__package_version__"], url="https://docs.tutor.overhang.io/", project_urls={ "Documentation": "https://docs.tutor.overhang.io/", diff --git a/tutor/__about__.py b/tutor/__about__.py index e1ffb83..1f1ad46 100644 --- a/tutor/__about__.py +++ b/tutor/__about__.py @@ -18,6 +18,11 @@ __version_suffix__ = "" # name. __app__ = os.environ.get("TUTOR_APP", "tutor") +# Package version, as installed by pip, does not include the version suffix. +# Otherwise, nightly plugins will automatically install non-nightly Tutor +# version. +__package_version__ = __version__ + if __version_suffix__: __version__ += "-" + __version_suffix__ __app__ += "-" + __version_suffix__