MCPcopy Index your code
hub / github.com/opencv/opencv-python / get_and_set_info

Function get_and_set_info

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

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…