Move remaining metadata to pyproject (#72469)

This commit is contained in:
Marc Mueller 2022-05-26 02:54:49 +02:00 committed by GitHub
parent 30edc039ae
commit 1ac71455cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 62 additions and 52 deletions

View file

@ -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)