From 6d8595ab5e0320b2bcc258e800cfafa045f5f0a9 Mon Sep 17 00:00:00 2001 From: stdweird Date: Mon, 12 Oct 2015 18:20:27 +0200 Subject: [PATCH] Do not reload the vsc modules by default --- lib/vsc/install/shared_setup.py | 9 +++++++-- setup.py | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vsc/install/shared_setup.py b/lib/vsc/install/shared_setup.py index a7d3946c..4618e91c 100644 --- a/lib/vsc/install/shared_setup.py +++ b/lib/vsc/install/shared_setup.py @@ -93,6 +93,7 @@ URL_GH_HPCUGENT = 'https://github.com/hpcugent/%(name)s' URL_GHUGENT_HPCUGENT = 'https://github.ugent.be/hpcugent/%(name)s' +RELOAD_VSC_MODS = False def find_extra_sdist_files(): """Looks for files to append to the FileList that is used by the egg_info.""" @@ -315,7 +316,10 @@ def reload_vsc_modules(self): # reimport for name in reload_vsc_modules: - __import__(name) + try: + __import__(name) + except ImportError: + log.error('Failed to reload/import %s (sys.path %s). Continuing, fingers crossed.' % (name, sys.path)) def force_xmlrunner(self): """ @@ -367,7 +371,8 @@ def run_tests(self): cleanup = self.setup_sys_path() - self.reload_vsc_modules() + if RELOAD_VSC_MODS: + self.reload_vsc_modules() res = TestCommand.run_tests(self) diff --git a/setup.py b/setup.py index d830cd6f..5b068d02 100755 --- a/setup.py +++ b/setup.py @@ -51,10 +51,12 @@ def remove_bdist_rpm_source_file(): shared_setup.remove_extra_bdist_rpm_files = remove_bdist_rpm_source_file +# Re-reload the vsc modules that vsc-base ships +shared_setup.RELOAD_VSC_MODS = True PACKAGE = { 'name': 'vsc-base', - 'version': '2.4.1', + 'version': '2.4.2', 'author': [sdw, jt, ag, kh], 'maintainer': [sdw, jt, ag, kh], 'packages': ['vsc', 'vsc.install', 'vsc.utils'],