Support legacy module version declarations
This commit is contained in:
@@ -338,8 +338,15 @@ text, count = re.subn(
|
||||
text,
|
||||
count=1,
|
||||
)
|
||||
if count == 0:
|
||||
text, count = re.subn(
|
||||
r'(?ms)(^manifest\s*=\s*ModuleManifest\(.*?^\s*version\s*=\s*)["\'][^"\']+["\'](,?\s*)$',
|
||||
rf'\1"{new_version}"\2',
|
||||
text,
|
||||
count=1,
|
||||
)
|
||||
if count != 1:
|
||||
raise SystemExit(f"could not update MODULE_VERSION in {path}")
|
||||
raise SystemExit(f"could not update module version declaration in {path}")
|
||||
path.write_text(text)
|
||||
PYCODE
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user