From fe112c76d21a4670705f6dcb39b295f58d538287 Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Mon, 19 Jan 2026 09:42:42 +0900 Subject: [PATCH 1/2] 2026-01-19 09:42:42 (Mon) > DW-Mac > derekwan From 069d820d29c0cd2c57d46ed2b14f2a009c48687c Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Mon, 19 Jan 2026 09:42:56 +0900 Subject: [PATCH 2/2] 2026-01-19 09:42:56 (Mon) > DW-Mac > derekwan --- .bumpversion.toml | 2 +- pyproject.toml | 2 +- src/tests/test_version.py | 10 ++++++++++ src/utilities/__init__.py | 2 +- src/utilities/version.py | 9 +++++++++ uv.lock | 2 +- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index b809d6541..9f97c6700 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,6 +1,6 @@ [tool.bumpversion] allow_dirty = true - current_version = "0.184.1" + current_version = "0.184.2" [[tool.bumpversion.files]] filename = "pyproject.toml" diff --git a/pyproject.toml b/pyproject.toml index c63bad886..4250c9abd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,7 +116,7 @@ name = "dycw-utilities" readme = "README.md" requires-python = ">= 3.12" - version = "0.184.1" + version = "0.184.2" [project.entry-points.pytest11] pytest-randomly = "utilities.pytest_plugins.pytest_randomly" diff --git a/src/tests/test_version.py b/src/tests/test_version.py index e5bc6a46e..4c313ddab 100644 --- a/src/tests/test_version.py +++ b/src/tests/test_version.py @@ -84,6 +84,11 @@ def test_bump_minor(self, *, version: Version2) -> None: assert bumped.minor == version.minor + 1 assert bumped.suffix is None + @given(version=version2s(), patch=integers(min_value=0)) + def test_version3(self, *, version: Version2, patch: int) -> None: + new = version.version3(patch=patch).version2 + assert new == version + @given(version=version2s(), suffix=text_ascii(min_size=1) | none()) def test_with_suffix(self, *, version: Version2, suffix: str | None) -> None: new = version.with_suffix(suffix=suffix) @@ -184,6 +189,11 @@ def test_with_suffix(self, *, version: Version3, suffix: str | None) -> None: assert new.patch == version.patch assert new.suffix == suffix + @given(version=version3s()) + def test_version2(self, *, version: Version3) -> None: + new = version.version2.version3(patch=version.patch) + assert new == version + @given(version=version3s()) def test_error_order(self, *, version: Version3) -> None: with raises(TypeError): diff --git a/src/utilities/__init__.py b/src/utilities/__init__.py index c57282b60..139749ed3 100644 --- a/src/utilities/__init__.py +++ b/src/utilities/__init__.py @@ -1,3 +1,3 @@ from __future__ import annotations -__version__ = "0.184.1" +__version__ = "0.184.2" diff --git a/src/utilities/version.py b/src/utilities/version.py index 141df7276..034b6359a 100644 --- a/src/utilities/version.py +++ b/src/utilities/version.py @@ -80,6 +80,10 @@ def bump_minor(self) -> Self: """Bump the minor component.""" return type(self)(self.major, self.minor + 1) + def version3(self, *, patch: int = 0) -> Version3: + """Convert to a Version3 object.""" + return Version3(self.major, self.minor, patch, suffix=self.suffix) + def with_suffix(self, *, suffix: str | None = None) -> Self: """Replace the suffix.""" return replace(self, suffix=suffix) @@ -212,6 +216,11 @@ def bump_patch(self) -> Self: """Bump the patch component.""" return type(self)(self.major, self.minor, self.patch + 1) + @property + def version2(self) -> Version2: + """Return the major/minor components only.""" + return Version2(self.major, self.minor, suffix=self.suffix) + def with_suffix(self, *, suffix: str | None = None) -> Self: """Replace the suffix.""" return replace(self, suffix=suffix) diff --git a/uv.lock b/uv.lock index 0755e73db..14a0b6d80 100644 --- a/uv.lock +++ b/uv.lock @@ -625,7 +625,7 @@ wheels = [ [[package]] name = "dycw-utilities" -version = "0.184.1" +version = "0.184.2" source = { editable = "." } dependencies = [ { name = "atomicwrites" },