Skip to content

Commit 3873a1e

Browse files
committed
chore: update bump_version script
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 6dd4f15 commit 3873a1e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

bin/bump_version.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
#!/usr/bin/env python3
22

3+
# /// script
4+
# dependencies = ["click", "packaging"]
5+
# ///
6+
37

48
from __future__ import annotations
59

10+
import configparser
611
import glob
712
import os
813
import subprocess
@@ -13,8 +18,6 @@
1318
import click
1419
from packaging.version import InvalidVersion, Version
1520

16-
import cibuildwheel
17-
1821
config = [
1922
# file path, version find/replace format
2023
("README.md", "cibuildwheel=={}"),
@@ -34,7 +37,10 @@
3437

3538
@click.command()
3639
def bump_version() -> None:
37-
current_version = cibuildwheel.__version__
40+
# Update if moving setup.cfg to pyproject.toml
41+
cfg = configparser.ConfigParser()
42+
cfg.read("setup.cfg")
43+
current_version = cfg["metadata"]["version"]
3844

3945
try:
4046
commit_date_str = subprocess.run(

0 commit comments

Comments
 (0)