(parentdir_prefix, root, verbose)
| 1112 | |
| 1113 | |
| 1114 | def versions_from_parentdir(parentdir_prefix, root, verbose): |
| 1115 | # Source tarballs conventionally unpack into a directory that includes |
| 1116 | # both the project name and a version string. |
| 1117 | dirname = os.path.basename(root) |
| 1118 | if not dirname.startswith(parentdir_prefix): |
| 1119 | if verbose: |
| 1120 | print("guessing rootdir is '%s', but '%s' doesn't start with " |
| 1121 | "prefix '%s'" % (root, dirname, parentdir_prefix)) |
| 1122 | raise NotThisMethod("rootdir doesn't start with parentdir_prefix") |
| 1123 | return {"version": dirname[len(parentdir_prefix):], |
| 1124 | "full-revisionid": None, |
| 1125 | "dirty": False, "error": None} |
| 1126 | |
| 1127 | SHORT_VERSION_PY = """ |
| 1128 | # This file was generated by 'versioneer.py' (0.15) from |
no test coverage detected