MCPcopy Create free account
hub / github.com/cztomczak/cefpython / check_cython_version

Function check_cython_version

tools/build.py:207–228  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205
206
207def check_cython_version():
208 print("[build.py] Check Cython version")
209 with open(os.path.join(TOOLS_DIR, "requirements.txt"), "rb") as fileobj:
210 contents = fileobj.read().decode("utf-8")
211 match = re.search(r"cython\s*==\s*([\d.]+)", contents,
212 flags=re.IGNORECASE)
213 assert match, "cython package not found in requirements.txt"
214 require_version = match.group(1)
215 try:
216 import Cython
217 version = Cython.__version__
218 except ImportError:
219 # noinspection PyUnusedLocal
220 Cython = None
221 print("[build.py] ERROR: Cython is not installed ({0} required)"
222 .format(require_version))
223 sys.exit(1)
224 if version != require_version:
225 print("[build.py] ERROR: Wrong Cython version: {0}. Required: {1}"
226 .format(version, require_version))
227 sys.exit(1)
228 print("[build.py] Cython version: {0}".format(version))
229
230
231def check_directories():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected