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

Function get_and_set_info

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

Source from the content-addressed store, hash-verified

262
263
264def get_and_set_info(contrib, headless, rolling, ci_build):
265 # cv2/version.py should be generated by running find_version.py
266 version = {}
267 here = os.path.abspath(os.path.dirname(__file__))
268 version_file = os.path.join(here, "cv2", "version.py")
269
270 # generate a fresh version.py always when Git repository exists
271 # (in sdists the version.py file already exists)
272 if os.path.exists(".git"):
273 old_args = sys.argv.copy()
274 sys.argv = ["", str(contrib), str(headless), str(rolling), str(ci_build)]
275 runpy.run_path("find_version.py", run_name="__main__")
276 sys.argv = old_args
277
278 with open(version_file) as fp:
279 exec(fp.read(), version)
280
281 return version["opencv_version"], version["contrib"], version["headless"], version["rolling"]
282
283
284def get_build_env_var_by_name(flag_name):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected