MCPcopy Create free account
hub / github.com/opencv/opencv-python / get_and_set_info

Function get_and_set_info

setup.py:491–508  ·  view source on GitHub ↗
(contrib, headless, rolling, ci_build)

Source from the content-addressed store, hash-verified

489
490
491def get_and_set_info(contrib, headless, rolling, ci_build):
492 # cv2/version.py should be generated by running find_version.py
493 version = {}
494 here = os.path.abspath(os.path.dirname(__file__))
495 version_file = os.path.join(here, "cv2", "version.py")
496
497 # generate a fresh version.py always when Git repository exists
498 # (in sdists the version.py file already exists)
499 if os.path.exists(".git"):
500 old_args = sys.argv.copy()
501 sys.argv = ["", str(contrib), str(headless), str(rolling), str(ci_build)]
502 runpy.run_path("find_version.py", run_name="__main__")
503 sys.argv = old_args
504
505 with open(version_file) as fp:
506 exec(fp.read(), version)
507
508 return version["opencv_version"], version["contrib"], version["headless"], version["rolling"]
509
510
511def get_build_env_var_by_name(flag_name):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected