def getFisxVersion(): cppDir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "src") content = open(os.path.join(cppDir, "fisx_version.h"), "r").readlines() for line in content: if "FISX_VERSION_STR" in line: version = line.split("FISX_VERSION_STR")[-1].replace("\n","") version = version.replace(" ","") return version[1:-1]
def chk_cython(VERSION): CYTHON_VERSION_REQUIRED = VERSION from distutils import log from distutils.version import StrictVersion as Version warn = lambda msg='': sys.stderr.write(msg + '\n') # cython_zip = 'cython.zip' if os.path.isfile(cython_zip): path = os.path.abspath(cython_zip) if sys.path[0] != path: sys.path.insert(0, path) log.info("adding '%s' to sys.path", cython_zip) # try: import Cython except ImportError: warn("*" * 80) warn() warn(" You need to generate C source files with Cython!!") warn(" Download and install Cython <http://www.cython.org>") warn() warn("*" * 80) return False # try: CYTHON_VERSION = Cython.__version__ except AttributeError: from Cython.Compiler.Version import version as CYTHON_VERSION CYTHON_VERSION = CYTHON_VERSION.split('+', 1)[0] for s in ('.alpha', 'alpha'): CYTHON_VERSION = CYTHON_VERSION.replace(s, 'a') for s in ('.beta', 'beta', '.rc', 'rc', '.c', 'c'): CYTHON_VERSION = CYTHON_VERSION.replace(s, 'b') if (CYTHON_VERSION_REQUIRED is not None and Version(CYTHON_VERSION) < Version(CYTHON_VERSION_REQUIRED)): warn("*" * 80) warn() warn(" You need to install Cython %s (you have version %s)" % (CYTHON_VERSION_REQUIRED, CYTHON_VERSION)) warn(" Download and install Cython <http://www.cython.org>") warn() warn("*" * 80) return False # return True
def chk_cython(VERSION): CYTHON_VERSION_REQUIRED = VERSION from distutils import log from distutils.version import StrictVersion as Version warn = lambda msg='': sys.stderr.write(msg+'\n') # cython_zip = 'cython.zip' if os.path.isfile(cython_zip): path = os.path.abspath(cython_zip) if sys.path[0] != path: sys.path.insert(0, path) log.info("adding '%s' to sys.path", cython_zip) # try: import Cython except ImportError: warn("*"*80) warn() warn(" You need to generate C source files with Cython!!") warn(" Download and install Cython <http://www.cython.org>") warn() warn("*"*80) return False # try: CYTHON_VERSION = Cython.__version__ except AttributeError: from Cython.Compiler.Version import version as CYTHON_VERSION CYTHON_VERSION = CYTHON_VERSION.split('+', 1)[0] for s in ('.alpha', 'alpha'): CYTHON_VERSION = CYTHON_VERSION.replace(s, 'a') for s in ('.beta', 'beta', '.rc', 'rc', '.c', 'c'): CYTHON_VERSION = CYTHON_VERSION.replace(s, 'b') if (CYTHON_VERSION_REQUIRED is not None and Version(CYTHON_VERSION) < Version(CYTHON_VERSION_REQUIRED)): warn("*"*80) warn() warn(" You need to install Cython %s (you have version %s)" % (CYTHON_VERSION_REQUIRED, CYTHON_VERSION)) warn(" Download and install Cython <http://www.cython.org>") warn() warn("*"*80) return False # return True