Update date in release script. [skip ci] (#8574)
This commit is contained in:
parent
0caf2be684
commit
8824b40961
@ -8,6 +8,7 @@ needed, run CMake .
|
||||
<major>.<minor>.<patch>-RC1
|
||||
"""
|
||||
import argparse
|
||||
import datetime
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
@ -62,6 +63,13 @@ def rpkg(major: int, minor: int, patch: int) -> None:
|
||||
description = (
|
||||
description[: matched.start(1)] + version + description[matched.end(1) :]
|
||||
)
|
||||
pattern = r"Date:\ ([0-9]+\-[0-9]+\-[0-9]+)"
|
||||
today = datetime.date.today()
|
||||
matched = re.search(pattern, description)
|
||||
assert matched, "Couldn't find date string in DESCRIPTION."
|
||||
description = (
|
||||
description[: matched.start(1)] + str(today) + description[matched.end(1) :]
|
||||
)
|
||||
with open(desc_path, "w") as fd:
|
||||
fd.write(description)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user