Skip to content

Commit a96ef70

Browse files
authored
Merge pull request ComputeCanada#10 from boegel/compare_versions
improve error message on version mismatch when using `--from-pr` + rename `UNKNOWN_VERSION` to `UNKNOWN_EASYBLOCKS_VERSION`
2 parents 0b18d96 + 4f7a4e4 commit a96ef70

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

easybuild/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
from easybuild.tools.repository.repository import init_repository
8484
from easybuild.tools.systemtools import check_easybuild_deps
8585
from easybuild.tools.testing import create_test_report, overall_test_report, regtest, session_state
86-
from easybuild.tools.version import EASYBLOCKS_VERSION, FRAMEWORK_VERSION, UNKNOWN_VERSION, different_major_versions
86+
from easybuild.tools.version import EASYBLOCKS_VERSION, FRAMEWORK_VERSION, UNKNOWN_EASYBLOCKS_VERSION
87+
from easybuild.tools.version import different_major_versions
8788

8889

8990
_log = None
@@ -620,7 +621,7 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None, pr
620621
from_pr_list, tweaked_ecs_paths) = cfg_settings
621622

622623
# compare running Framework and EasyBlocks versions
623-
if EASYBLOCKS_VERSION == UNKNOWN_VERSION:
624+
if EASYBLOCKS_VERSION == UNKNOWN_EASYBLOCKS_VERSION:
624625
# most likely reason is running framework unit tests with no easyblocks installation
625626
# so log a warning, to avoid test related issues
626627
_log.warning("Unable to determine EasyBlocks version, so we'll assume it is not different from Framework")

easybuild/tools/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ def fetch_files_from_pr(pr, path=None, github_user=None, github_account=None, gi
594594
ver = _get_version_for_repo(os.path.join(final_path, 'easybuild', 'easyblocks', '__init__.py'))
595595

596596
if different_major_versions(FRAMEWORK_VERSION, ver):
597-
raise EasyBuildError("Framework (%s) is a different major version than PR target (%s)." % (FRAMEWORK_VERSION,
598-
ver))
597+
raise EasyBuildError("Framework (%s) is a different major version than used in %s/%s PR #%s (%s)",
598+
FRAMEWORK_VERSION, github_account, github_repo, pr, ver)
599599

600600
return files
601601

easybuild/tools/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
# This causes problems further up the dependency chain...
4848
VERSION = LooseVersion('4.9.2.dev0')
4949
UNKNOWN = 'UNKNOWN'
50-
UNKNOWN_VERSION = '0.0.UNKNOWN.EASYBLOCKS'
50+
UNKNOWN_EASYBLOCKS_VERSION = '0.0.UNKNOWN.EASYBLOCKS'
5151

5252

5353
def get_git_revision():
@@ -88,7 +88,7 @@ def get_git_revision():
8888
try:
8989
from easybuild.easyblocks import VERBOSE_VERSION as EASYBLOCKS_VERSION
9090
except Exception:
91-
EASYBLOCKS_VERSION = UNKNOWN_VERSION # make sure it is smaller then anything
91+
EASYBLOCKS_VERSION = UNKNOWN_EASYBLOCKS_VERSION # make sure it is smaller then anything
9292

9393

9494
def this_is_easybuild():

0 commit comments

Comments
 (0)