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

Function versions_from_parentdir

versioneer.py:1348–1369  ·  view source on GitHub ↗

Try to determine the version from the parent directory name. Source tarballs conventionally unpack into a directory that includes both the project name and a version string. We will also support searching up two directory levels for an appropriately named parent directory

(parentdir_prefix, root, verbose)

Source from the content-addressed store, hash-verified

1346
1347
1348def versions_from_parentdir(parentdir_prefix, root, verbose):
1349 """Try to determine the version from the parent directory name.
1350
1351 Source tarballs conventionally unpack into a directory that includes both
1352 the project name and a version string. We will also support searching up
1353 two directory levels for an appropriately named parent directory
1354 """
1355 rootdirs = []
1356
1357 for _ in range(3):
1358 dirname = os.path.basename(root)
1359 if dirname.startswith(parentdir_prefix):
1360 return {"version": dirname[len(parentdir_prefix):],
1361 "full-revisionid": None,
1362 "dirty": False, "error": None, "date": None}
1363 rootdirs.append(root)
1364 root = os.path.dirname(root) # up a level
1365
1366 if verbose:
1367 print("Tried directories %s but none started with prefix %s" %
1368 (str(rootdirs), parentdir_prefix))
1369 raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
1370
1371
1372SHORT_VERSION_PY = """

Callers 1

get_versionsFunction · 0.70

Calls 2

NotThisMethodClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…