fix: package version in nightly

The string returned by "make version" should not include the "-nightly"
suffix, otherwise tests fail.
This commit is contained in:
Régis Behmo 2022-03-31 15:36:30 +02:00
parent fa32269e91
commit 0500bfe9a6
3 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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/",

View File

@ -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__