chore: update bump_version script

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner
2024-05-11 23:38:45 -04:00
parent 6dd4f15a0e
commit 3873a1edf8
+9 -3
View File
@@ -1,8 +1,13 @@
#!/usr/bin/env python3
# /// script
# dependencies = ["click", "packaging"]
# ///
from __future__ import annotations
import configparser
import glob
import os
import subprocess
@@ -13,8 +18,6 @@ from pathlib import Path
import click
from packaging.version import InvalidVersion, Version
import cibuildwheel
config = [
# file path, version find/replace format
("README.md", "cibuildwheel=={}"),
@@ -34,7 +37,10 @@ OFF = "\u001b[0m"
@click.command()
def bump_version() -> None:
current_version = cibuildwheel.__version__
# Update if moving setup.cfg to pyproject.toml
cfg = configparser.ConfigParser()
cfg.read("setup.cfg")
current_version = cfg["metadata"]["version"]
try:
commit_date_str = subprocess.run(