MCPcopy Create free account
hub / github.com/microsoft/debugpy / versions_from_file

Function versions_from_file

versioneer.py:1390–1404  ·  view source on GitHub ↗

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

(filename)

Source from the content-addressed store, hash-verified

1388
1389
1390def versions_from_file(filename):
1391 """Try to determine the version from _version.py if present."""
1392 try:
1393 with open(filename) as f:
1394 contents = f.read()
1395 except OSError:
1396 raise NotThisMethod("unable to read _version.py")
1397 mo = re.search(r"version_json = '''\n(.*)''' # END VERSION_JSON",
1398 contents, re.M | re.S)
1399 if not mo:
1400 mo = re.search(r"version_json = '''\r\n(.*)''' # END VERSION_JSON",
1401 contents, re.M | re.S)
1402 if not mo:
1403 raise NotThisMethod("no version_json in _version.py")
1404 return json.loads(mo.group(1))
1405
1406
1407def write_to_version_file(filename, versions):

Callers 1

get_versionsFunction · 0.85

Calls 4

searchMethod · 0.80
loadsMethod · 0.80
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…