diff --git a/run_tests.py b/run_tests.py index 5bef5170a..b7e6b8b2c 100755 --- a/run_tests.py +++ b/run_tests.py @@ -70,7 +70,7 @@ my_script)) print( "Note: long testing requires nose and coverage, which are easily installed by `pip install`") - sys.exit(0) + sys.exit(1) print("start testing. Go to ./tests folder") os.chdir("./tests/") @@ -79,7 +79,7 @@ os.system("python ./run_simple_test.py") print('\nHAPPY COMPUTING') print(art) - sys.exit(0) + sys.exit(1) else: if with_coverage: os.system("{bin}/nosetests --with-coverage --cover-package pytraj -vs .".format(bin=bin)) diff --git a/scripts/base_setup.py b/scripts/base_setup.py index 76825a347..7a0b05cbc 100644 --- a/scripts/base_setup.py +++ b/scripts/base_setup.py @@ -125,7 +125,7 @@ def check_cpptraj_version(header_dir, version=(4, 2, 9)): int_version = tuple(int(i) for i in line.split()[-1].strip('"').replace('V', '').split('.')) if int_version < version: sys.stderr.write('must have cpptraj version >= {}\n'.format(version)) - sys.exit(0) + sys.exit(1) def remind_export_LD_LIBRARY_PATH(build_tag, libdir, pytraj_inside_amber): @@ -287,11 +287,11 @@ def try_updating_libcpptraj(cpptraj_home, except CalledProcessError: print( 'can not install libcpptraj, you need to install it manually \n') - sys.exit(0) + sys.exit(1) else: print('can not find libcpptraj in $CPPTRAJHOME/lib. ' 'You need to install ``libcpptraj`` manually. ') - sys.exit(0) + sys.exit(1) def add_openmp_flag(disable_openmp, @@ -339,10 +339,10 @@ def check_cython(ISRELEASED, cmdclass, min_version='0.21'): cmdclass['build_ext'] = build_ext if Cython.__version__ < min_version: print(message_cython) - sys.exit(0) + sys.exit(1) except ImportError: print(message_cython) - sys.exit(0) + sys.exit(1) return need_cython, cmdclass, cythonize @@ -391,7 +391,7 @@ def get_include_and_lib_dir(rootname, cpptrajhome, has_cpptraj_in_current_folder except CalledProcessError: print( 'can not install libcpptraj, you need to install it manually \n') - sys.exit(0) + sys.exit(1) cpptraj_dir = os.path.join(rootname, "cpptraj") cpptraj_include = os.path.join(cpptraj_dir, 'src') libdir = os.path.join(cpptraj_dir, 'lib') diff --git a/scripts/cythonize.py b/scripts/cythonize.py index 2feb01dc1..e26ff5c3d 100755 --- a/scripts/cythonize.py +++ b/scripts/cythonize.py @@ -6,7 +6,7 @@ if Cython.__version__ < '0.21': sys.stderr.write('require cython version >=0.21') - sys.exit(0) + sys.exit(1) DEBUG = False diff --git a/scripts/find_lib.py b/scripts/find_lib.py index 1e94e08d2..3a4c48436 100644 --- a/scripts/find_lib.py +++ b/scripts/find_lib.py @@ -59,6 +59,6 @@ def find_lib(libname, unique=True): import sys if len(sys.argv) == 1: - sys.exit(0) + sys.exit(1) print(find_lib(sys.argv[1])) diff --git a/setup.py b/setup.py index be0b8f1e8..ea69a4c53 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ # python version >= 2.6 if sys.version_info < (2, 6): print('You must have at least Python 2.6 for pytraj\n') - sys.exit(0) + sys.exit(1) amber_release = check_flag('--amber_release') disable_openmp = check_flag('--disable-openmp') @@ -164,7 +164,7 @@ def read(fname): output_openmp_check = subprocess.check_output(['nm', libcpptraj_files[0]]).decode().split('\n') except IndexError: print("Warning: It seems that there is no libcpptraj. Please install it") - sys.exit(0) + sys.exit(1) libcpptraj_has_openmp = ([line for line in output_openmp_check if 'omp_get_num_threads' in line.lower()] != []) if libcpptraj_has_openmp and sys.platform == 'darwin':