diff --git a/github_rest_api/actions/utils.py b/github_rest_api/actions/utils.py index 2effa27..2b42c68 100644 --- a/github_rest_api/actions/utils.py +++ b/github_rest_api/actions/utils.py @@ -73,25 +73,3 @@ def commit_profiling(prof_dir: str | Path): """ 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!") 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!") 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"