6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-10 23:30:59 +00:00

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 ###### Additional commands
version: ## Print the current tutor version 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 =  ESCAPE = 
help: ## Print this help help: ## Print this help

View File

@ -40,7 +40,7 @@ ABOUT = load_about()
setup( setup(
name="tutor", name="tutor",
version=ABOUT["__version__"].split("-")[0], # drop "-nightly" suffix if present version=ABOUT["__package_version__"],
url="https://docs.tutor.overhang.io/", url="https://docs.tutor.overhang.io/",
project_urls={ project_urls={
"Documentation": "https://docs.tutor.overhang.io/", "Documentation": "https://docs.tutor.overhang.io/",

View File

@ -18,6 +18,11 @@ __version_suffix__ = ""
# name. # name.
__app__ = os.environ.get("TUTOR_APP", "tutor") __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__: if __version_suffix__:
__version__ += "-" + __version_suffix__ __version__ += "-" + __version_suffix__
__app__ += "-" + __version_suffix__ __app__ += "-" + __version_suffix__