Skip to content

Commit

Permalink
fix: package version in nightly
Browse files Browse the repository at this point in the history
The string returned by "make version" should not include the "-nightly"
suffix, otherwise tests fail.
  • Loading branch information
regisb committed Mar 31, 2022
1 parent fa32269 commit 0500bfe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def is_requirement(line: str) -> bool:

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/",
Expand Down
5 changes: 5 additions & 0 deletions tutor/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
# 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__

0 comments on commit 0500bfe

Please sign in to comment.