From 24d4ebdcc7e9a758514b9fc5e04ce9a0b68d5bb8 Mon Sep 17 00:00:00 2001 From: Ben Du Date: Sun, 11 Jan 2026 18:46:35 -0800 Subject: [PATCH 1/2] move strip_*_version to github_rest_api/utils.py --- github_rest_api/actions/utils.py | 24 +----------------------- github_rest_api/utils.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/github_rest_api/actions/utils.py b/github_rest_api/actions/utils.py index 2effa27..240fcfd 100644 --- a/github_rest_api/actions/utils.py +++ b/github_rest_api/actions/utils.py @@ -72,26 +72,4 @@ def commit_profiling(prof_dir: str | Path): :param prof_dir: The profiling directory. """ porcelain.add(paths=prof_dir) - porcelain.commit(message="Updating profiling results.") - - -def strip_patch_version(version: str) -> str: - parts = version.split(".") - match len(parts): - case 1: - return parts[0] + ".0.0" - case 2 | 3: - return ".".join(parts[:2]) + ".0" - case _: - raise ValueError("Invalid version semantic provided!") - - -def strip_minor_version(version: str) -> str: - parts = version.split(".") - match len(parts): - case 1: - return parts[0] + ".0.0" - case 2 | 3: - return ".".join(parts[:1]) + ".0.0" - case _: - raise ValueError("Invalid version semantic provided!") + porcelain.commit(message="Updating profiling results.") \ No newline at end of file diff --git a/github_rest_api/utils.py b/github_rest_api/utils.py index 26f6b7e..9eb45e9 100644 --- a/github_rest_api/utils.py +++ b/github_rest_api/utils.py @@ -10,3 +10,25 @@ def partition(pred, iterable): """ it1, it2 = tee(iterable) return filter(pred, it1), filterfalse(pred, it2) + + +def strip_patch_version(version: str) -> str: + parts = version.split(".") + match len(parts): + case 1: + return parts[0] + ".0.0" + case 2 | 3: + return ".".join(parts[:2]) + ".0" + case _: + raise ValueError("Invalid version semantic provided!") + + +def strip_minor_version(version: str) -> str: + parts = version.split(".") + match len(parts): + case 1: + return parts[0] + ".0.0" + case 2 | 3: + return ".".join(parts[:1]) + ".0.0" + case _: + raise ValueError("Invalid version semantic provided!") From c6a7f0f7c141f70c87a44334b656893cc36b778e Mon Sep 17 00:00:00 2001 From: Ben Du Date: Sun, 11 Jan 2026 18:47:58 -0800 Subject: [PATCH 2/2] bump up version --- github_rest_api/actions/utils.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/github_rest_api/actions/utils.py b/github_rest_api/actions/utils.py index 240fcfd..2b42c68 100644 --- a/github_rest_api/actions/utils.py +++ b/github_rest_api/actions/utils.py @@ -72,4 +72,4 @@ def commit_profiling(prof_dir: str | Path): :param prof_dir: The profiling directory. """ porcelain.add(paths=prof_dir) - porcelain.commit(message="Updating profiling results.") \ No newline at end of file + porcelain.commit(message="Updating profiling results.") diff --git a/pyproject.toml b/pyproject.toml index ce0808e..c6aad3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "github_rest_api" -version = "0.28.0" +version = "0.29.0" description = "Simple wrapper of GitHub REST APIs." authors = [{ name = "Ben Du", email = "longendu@yahoo.com" }] requires-python = ">=3.11,<4"