chore: update bump_version script
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
+9
-3
@@ -1,8 +1,13 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# /// script
|
||||||
|
# dependencies = ["click", "packaging"]
|
||||||
|
# ///
|
||||||
|
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import configparser
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -13,8 +18,6 @@ from pathlib import Path
|
|||||||
import click
|
import click
|
||||||
from packaging.version import InvalidVersion, Version
|
from packaging.version import InvalidVersion, Version
|
||||||
|
|
||||||
import cibuildwheel
|
|
||||||
|
|
||||||
config = [
|
config = [
|
||||||
# file path, version find/replace format
|
# file path, version find/replace format
|
||||||
("README.md", "cibuildwheel=={}"),
|
("README.md", "cibuildwheel=={}"),
|
||||||
@@ -34,7 +37,10 @@ OFF = "\u001b[0m"
|
|||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
def bump_version() -> None:
|
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:
|
try:
|
||||||
commit_date_str = subprocess.run(
|
commit_date_str = subprocess.run(
|
||||||
|
|||||||
Reference in New Issue
Block a user