Skip to content

Commit

Permalink
Create bump_version_setupcfg.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tmart234 authored Oct 30, 2023
1 parent 3ceec75 commit 7208c6e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/bump_version_setupcfg.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 7208c6e

Please sign in to comment.