Migrate to pyproject.toml

This commit is contained in:
2025-11-06 13:51:26 +01:00
parent 58ef47468e
commit 57c0037289
4 changed files with 54 additions and 32 deletions

View File

@@ -22,7 +22,7 @@ def main():
with open(version_filepath) as f:
file_content = f.read()
version = re.search(r'__version__ = "(.*?)"', file_content).group(1)
version = re.search(r'__version__ = "(.+?)"', file_content).group(1)
major, minor, patch = map(int, version.split(sep="."))
if args.level == "patch":
@@ -38,7 +38,7 @@ def main():
new_version = f"{major}.{minor}.{patch}"
with open(version_filepath, "w") as f:
f.write(re.sub(r'__version__ = "(.*?)"', f'__version__ = "{new_version}"', file_content))
f.write(re.sub(r'__version__ = "(.+?)"', f'__version__ = "{new_version}"', file_content))
os.system(f"git commit {version_filepath} -m 'Updating for version {new_version}'")
os.system(f"git tag -a {new_version} -m 'Release {new_version}'")