MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / versions_from_file

Function versions_from_file

versioneer.py:1403–1415  ·  view source on GitHub ↗

Try to determine the version from _version.py if present.

(filename)

Source from the content-addressed store, hash-verified

1401
1402
1403def versions_from_file(filename):
1404 """Try to determine the version from _version.py if present."""
1405 try:
1406 with open(filename) as f:
1407 contents = f.read()
1408 except OSError:
1409 raise NotThisMethod("unable to read _version.py")
1410 mo = re.search(r"version_json = '''\n(.*)''' # END VERSION_JSON", contents, re.M | re.S)
1411 if not mo:
1412 mo = re.search(r"version_json = '''\r\n(.*)''' # END VERSION_JSON", contents, re.M | re.S)
1413 if not mo:
1414 raise NotThisMethod("no version_json in _version.py")
1415 return json.loads(mo.group(1))
1416
1417
1418def write_to_version_file(filename, versions):

Callers 1

get_versionsFunction · 0.85

Calls 2

NotThisMethodClass · 0.70
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…