Skip to content

Commit 05b3b6b

Browse files
committed
updating publishing infra
1 parent 3455865 commit 05b3b6b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/update_version.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,18 @@ def update_version(new_version=None):
7474
)
7575
init_file.write_text(new_content)
7676

77+
# Update version in pyproject.toml
78+
pyproject_file = Path("pyproject.toml")
79+
content = pyproject_file.read_text()
80+
new_content = re.sub(
81+
r'(version\s*=\s*[\'"])[^\'"]+([\'"])',
82+
rf'\g<1>{new_version}\2',
83+
content
84+
)
85+
pyproject_file.write_text(new_content)
86+
7787
# Commit and push changes
78-
subprocess.run(['git', 'add', 'src/python_introspect/__init__.py'], check=True)
88+
subprocess.run(['git', 'add', 'src/python_introspect/__init__.py', 'pyproject.toml'], check=True)
7989
subprocess.run(['git', 'commit', '-m', f'bump version to {new_version}'], check=True)
8090
subprocess.run(['git', 'push', 'origin', 'main'], check=True)
8191

0 commit comments

Comments
 (0)