From 7208c6e5445384d67b405b76197438488388f0a9 Mon Sep 17 00:00:00 2001 From: Tyler M Date: Mon, 30 Oct 2023 14:11:15 -0600 Subject: [PATCH] Create bump_version_setupcfg.py --- .github/bump_version_setupcfg.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/bump_version_setupcfg.py diff --git a/.github/bump_version_setupcfg.py b/.github/bump_version_setupcfg.py new file mode 100644 index 0000000..ce2c9b8 --- /dev/null +++ b/.github/bump_version_setupcfg.py @@ -0,0 +1,19 @@ +# bump_version_setupcfg.py + +import re + +with open("setup.cfg", "r") as f: + content = f.read() + +# Extract version from setup.cfg +version = re.search(r'version\s*=\s*(.+)', content).group(1) +major, minor, patch = map(int, version.split(".")) + +# Bump patch version +new_version = f"{major}.{minor}.{patch + 1}" + +# Replace in content +updated_content = content.replace(f'version = {version}', f'version = {new_version}') + +with open("setup.cfg", "w") as f: + f.write(updated_content)