style: Modernize type hints in bump_version.py
- Replace typing.Tuple with modern tuple syntax - Remove deprecated typing imports per ruff suggestions - Maintain Python 3.10+ compatibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -13,10 +13,9 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Tuple
|
|
||||||
|
|
||||||
|
|
||||||
def parse_version(version_string: str) -> Tuple[int, int, int]:
|
def parse_version(version_string: str) -> tuple[int, int, int]:
|
||||||
"""Parse semantic version string into tuple of integers."""
|
"""Parse semantic version string into tuple of integers."""
|
||||||
match = re.match(r"^(\d+)\.(\d+)\.(\d+)", version_string)
|
match = re.match(r"^(\d+)\.(\d+)\.(\d+)", version_string)
|
||||||
if not match:
|
if not match:
|
||||||
@@ -24,7 +23,7 @@ def parse_version(version_string: str) -> Tuple[int, int, int]:
|
|||||||
return int(match.group(1)), int(match.group(2)), int(match.group(3))
|
return int(match.group(1)), int(match.group(2)), int(match.group(3))
|
||||||
|
|
||||||
|
|
||||||
def bump_version(version: Tuple[int, int, int], bump_type: str) -> Tuple[int, int, int]:
|
def bump_version(version: tuple[int, int, int], bump_type: str) -> tuple[int, int, int]:
|
||||||
"""Apply version bump according to semantic versioning rules."""
|
"""Apply version bump according to semantic versioning rules."""
|
||||||
major, minor, patch = version
|
major, minor, patch = version
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user