Move remaining metadata to pyproject (#72469)
This commit is contained in:
parent
30edc039ae
commit
1ac71455cb
10 changed files with 62 additions and 52 deletions
|
@ -121,13 +121,13 @@ def write_version(version):
|
|||
|
||||
|
||||
def write_version_metadata(version: Version) -> None:
|
||||
"""Update setup.cfg file with new version."""
|
||||
with open("setup.cfg") as fp:
|
||||
"""Update pyproject.toml file with new version."""
|
||||
with open("pyproject.toml", encoding="utf8") as fp:
|
||||
content = fp.read()
|
||||
|
||||
content = re.sub(r"(version\W+=\W).+\n", f"\\g<1>{version}\n", content, count=1)
|
||||
content = re.sub(r"(version\W+=\W).+\n", f'\\g<1>"{version}"\n', content, count=1)
|
||||
|
||||
with open("setup.cfg", "w") as fp:
|
||||
with open("pyproject.toml", "w", encoding="utf8") as fp:
|
||||
fp.write(content)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue