Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-dunamai for openSUSE:Factory 
checked in at 2026-11-10 14:38:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-dunamai (Old)
 and      /work/SRC/openSUSE:Factory/.python-dunamai.new.3759290 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-dunamai"

Tue Nov 10 14:38:15 2026 rev:16 rq:1396169 version:1.26.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-dunamai/python-dunamai.changes    
2026-08-11 17:09:19.590194343 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-dunamai.new.3759290/python-dunamai.changes   
    2026-11-10 14:38:19.861318666 +0100
@@ -1,0 +2,10 @@
+Sun Nov  8 18:59:23 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 1.26.4:
+  * Fixed: Hyphenated tags in the `describe` field in
+    `.git_archival.json` were not parsed correctly
+    when the repository was exactly on a tagged commit.
+  * Fixed: `Version.bump()` ignored the `increment` when a stage
+    had no revision.
+
+-------------------------------------------------------------------

Old:
----
  python-dunamai-1.26.2.tar.gz

New:
----
  python-dunamai-1.26.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-dunamai.spec ++++++
--- /var/tmp/diff_new_pack.LBb7vp/_old  2026-11-10 14:38:20.838359557 +0100
+++ /var/tmp/diff_new_pack.LBb7vp/_new  2026-11-10 14:38:20.842359725 +0100
@@ -20,7 +20,7 @@
 %bcond_without  libalternatives
 %define         modname dunamai
 Name:           python-dunamai
-Version:        1.26.2
+Version:        1.26.4
 Release:        0
 Summary:        Dynamic version generation
 License:        MIT

++++++ python-dunamai-1.26.2.tar.gz -> python-dunamai-1.26.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dunamai-1.26.2/CHANGELOG.md 
new/dunamai-1.26.4/CHANGELOG.md
--- old/dunamai-1.26.2/CHANGELOG.md     1970-01-01 01:00:00.000000000 +0100
+++ new/dunamai-1.26.4/CHANGELOG.md     1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +1,14 @@
+## v1.26.4 (2026-11-07)
+
+* Fixed: Hyphenated tags in the `describe` field in `.git_archival.json` were 
not parsed correctly
+  when the repository was exactly on a tagged commit.
+  ([Contributed by TohruSu](https://github.com/mtkennerly/dunamai/pull/120))
+
+## v1.26.3 (2026-10-14)
+
+* Fixed: `Version.bump()` ignored the `increment` when a stage had no revision.
+  ([Contributed by afonsojanu](https://github.com/mtkennerly/dunamai/pull/116))
+
 ## v1.26.2 (2026-08-01)
 
 * Fixed: With `highest_tag` enabled, a `pattern`/`pattern_prefix` that only 
some
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dunamai-1.26.2/PKG-INFO new/dunamai-1.26.4/PKG-INFO
--- old/dunamai-1.26.2/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/dunamai-1.26.4/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: dunamai
-Version: 1.26.2
+Version: 1.26.4
 Summary: Dynamic version generation
 License: MIT
 License-File: LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dunamai-1.26.2/dunamai/__init__.py 
new/dunamai-1.26.4/dunamai/__init__.py
--- old/dunamai-1.26.2/dunamai/__init__.py      1970-01-01 01:00:00.000000000 
+0100
+++ new/dunamai-1.26.4/dunamai/__init__.py      1970-01-01 01:00:00.000000000 
+0100
@@ -898,6 +898,8 @@
 
         This uses inexact heuristics, so its output may vary slightly between
         releases. Consider this a "best effort" conversion.
+        It makes some assumptions about how the version and metadata may be 
ordered,
+        and is geared toward parsing Dunamai's default output format.
 
         :param version: Full version, such as 0.3.0a3+d7.gb6a9020.dirty.
         :param pattern: Regular expression matched against the version.
@@ -1013,7 +1015,10 @@
             bumped.base = bump_version(bumped.base, index, increment)
         else:
             if bumped.revision is None:
-                bumped.revision = 2
+                # A stage without an explicit revision is implicitly revision 1
+                # (e.g. "rc" means "rc1"), so bump from there instead of
+                # ignoring `increment` and always landing on 2.
+                bumped.revision = 1 + increment
             else:
                 bumped.revision += increment
         return bumped
@@ -1129,10 +1134,14 @@
                         describe = describe[:-6]
                     else:
                         dirty = False
-                    parts = describe.rsplit("-", 2)
-                    tag = parts[0]
-                    if len(parts) > 1:
-                        distance = int(parts[1])
+                    # On a tagged commit, this is just the tag, which may 
contain hyphens.
+                    # Otherwise, it ends with `-<distance>-g<commit>`.
+                    describe_match = re.match(r"^(.+)-(\d+)-g[0-9a-f]+$", 
describe)
+                    if describe_match:
+                        tag = describe_match.group(1)
+                        distance = int(describe_match.group(2))
+                    else:
+                        tag = describe
 
                 if tag is None:
                     return cls._fallback(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dunamai-1.26.2/pyproject.toml 
new/dunamai-1.26.4/pyproject.toml
--- old/dunamai-1.26.2/pyproject.toml   1970-01-01 01:00:00.000000000 +0100
+++ new/dunamai-1.26.4/pyproject.toml   1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "dunamai"
-version = "1.26.2"
+version = "1.26.4"
 description = "Dynamic version generation"
 license = "MIT"
 authors = ["Matthew T. Kennerly <[email protected]>"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dunamai-1.26.2/tests/archival/git-tagged-prerelease/.git_archival.json 
new/dunamai-1.26.4/tests/archival/git-tagged-prerelease/.git_archival.json
--- old/dunamai-1.26.2/tests/archival/git-tagged-prerelease/.git_archival.json  
1970-01-01 01:00:00.000000000 +0100
+++ new/dunamai-1.26.4/tests/archival/git-tagged-prerelease/.git_archival.json  
1970-01-01 01:00:00.000000000 +0100
@@ -0,0 +1,7 @@
+{
+  "hash-full": "8fe614dbf9e767e70442ab8f56e99bd08d7e782d",
+  "hash-short": "8fe614d",
+  "timestamp": "2022-11-07T07:07:50+08:00",
+  "refs": "HEAD -> master, tag: v0.1.0-rc.1",
+  "describe": "v0.1.0-rc.1"
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dunamai-1.26.2/tests/archival/git-tagged-prerelease-post/.git_archival.json 
new/dunamai-1.26.4/tests/archival/git-tagged-prerelease-post/.git_archival.json
--- 
old/dunamai-1.26.2/tests/archival/git-tagged-prerelease-post/.git_archival.json 
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/dunamai-1.26.4/tests/archival/git-tagged-prerelease-post/.git_archival.json 
    1970-01-01 01:00:00.000000000 +0100
@@ -0,0 +1,7 @@
+{
+  "hash-full": "1b57ff77e01728b301088b9d57e3922d156c7ec3",
+  "hash-short": "1b57ff7",
+  "timestamp": "2022-11-07T07:16:59+08:00",
+  "refs": "HEAD -> master",
+  "describe": "v0.1.0-rc.1-1-g1b57ff7"
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dunamai-1.26.2/tests/integration/test_dunamai.py 
new/dunamai-1.26.4/tests/integration/test_dunamai.py
--- old/dunamai-1.26.2/tests/integration/test_dunamai.py        1970-01-01 
01:00:00.000000000 +0100
+++ new/dunamai-1.26.4/tests/integration/test_dunamai.py        1970-01-01 
01:00:00.000000000 +0100
@@ -32,6 +32,21 @@
     return _get_git_version() < version
 
 
+def git_init(run: Callable, name: str, ref_format: Optional[str] = None) -> 
None:
+    version = _get_git_version()
+
+    if ref_format is not None and version >= [2, 45]:
+        run("git init --ref-format={}".format(ref_format))
+    else:
+        run("git init")
+
+    try:
+        # Compatibility for newer Git versions:
+        run("git branch -m {}".format(name))
+    except Exception:
+        pass
+
+
 REPO = Path(__file__).parent.parent.parent
 
 
@@ -107,12 +122,7 @@
     legacy = is_git_legacy()
 
     with chdir(tmp_path):
-        run("git init")
-        try:
-            # Compatibility for newer Git versions:
-            run("git branch -m master")
-        except Exception:
-            pass
+        git_init(run, b)
         assert from_vcs(fresh=True) == Version("0.0.0", distance=0, 
dirty=True, branch=b)
         assert from_vcs(fresh=True).vcs == Vcs.Git
 
@@ -250,7 +260,7 @@
     legacy = is_git_legacy()
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         (tmp_path / "foo.txt").write_text("hi")
         run("git add .")
         run('git commit --no-gpg-sign -m "Initial commit"')
@@ -298,7 +308,7 @@
     b = "master"
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         (tmp_path / "foo.txt").write_text("hi")
         run("git add .")
         run('git commit --no-gpg-sign -m "Initial commit"')
@@ -336,7 +346,7 @@
         return from_vcs(pattern="default-unprefixed", pattern_prefix="foo-", 
**kwargs)
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         (tmp_path / "foo.txt").write_text("1")
         run("git add .")
         run('git commit --no-gpg-sign -m "First"')
@@ -379,7 +389,7 @@
         return from_vcs(pattern="default-unprefixed", pattern_prefix="foo-", 
**kwargs)
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         (tmp_path / "foo.txt").write_text("1")
         run("git add .")
         run('git commit --no-gpg-sign -m "First"')
@@ -400,12 +410,13 @@
 def test__version__from_git__highest_tag_with_no_matching_tags(tmp_path) -> 
None:
     run = make_run_callback(tmp_path)
     from_vcs = make_from_callback(Version.from_git)
+    b = "master"
 
     def from_missing(**kwargs):
         return from_vcs(pattern="default-unprefixed", 
pattern_prefix="missing-", **kwargs)
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         (tmp_path / "foo.txt").write_text("1")
         run("git add .")
         run('git commit --no-gpg-sign -m "First"')
@@ -425,7 +436,7 @@
     legacy = is_git_legacy()
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         (tmp_path / "foo.txt").write_text("hi")
         run("git add .")
         run(
@@ -464,7 +475,7 @@
     b2 = "develop"
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         (tmp_path / "foo.txt").write_text("hi")
         run("git add .")
         run("git commit --no-gpg-sign -m Initial")
@@ -558,6 +569,38 @@
         assert detected._newer_unmatched_tags == []
 
 
+def test__version__from_git__archival_tagged_prerelease() -> None:
+    with chdir(REPO / "tests" / "archival" / "git-tagged-prerelease"):
+        detected = Version.from_git()
+        assert detected == Version(
+            "0.1.0",
+            stage=("rc", 1),
+            branch="master",
+            dirty=False,
+            distance=0,
+            commit="8fe614d",
+            timestamp=dt.datetime(2022, 11, 6, 23, 7, 50, 
tzinfo=dt.timezone.utc),
+        )
+        assert detected._matched_tag == "v0.1.0-rc.1"
+        assert detected._newer_unmatched_tags == []
+
+
+def test__version__from_git__archival_tagged_prerelease_post() -> None:
+    with chdir(REPO / "tests" / "archival" / "git-tagged-prerelease-post"):
+        detected = Version.from_git()
+        assert detected == Version(
+            "0.1.0",
+            stage=("rc", 1),
+            branch="master",
+            dirty=False,
+            distance=1,
+            commit="1b57ff7",
+            timestamp=dt.datetime(2022, 11, 6, 23, 16, 59, 
tzinfo=dt.timezone.utc),
+        )
+        assert detected._matched_tag == "v0.1.0-rc.1"
+        assert detected._newer_unmatched_tags == []
+
+
 @pytest.mark.skipif(shutil.which("git") is None, reason="Requires Git")
 def test__version__from_git__shallow(tmp_path) -> None:
     run = make_run_callback(tmp_path)
@@ -575,9 +618,10 @@
 def test__version__from_git__trace_env_var(tmp_path) -> None:
     run = make_run_callback(tmp_path)
     env = {**os.environ, "GIT_TRACE": "1"}
+    b = "master"
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         (tmp_path / "foo.txt").write_text("hi")
         run("git add .")
         run("git commit --no-gpg-sign -m Initial")
@@ -592,7 +636,7 @@
     b = "master"
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         (tmp_path / "foo.txt").write_text("hi")
         run("git add .")
         run("git commit --no-gpg-sign -m Initial")
@@ -611,7 +655,7 @@
     b = "master"
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b, ref_format="files")
         (tmp_path / "foo.txt").write_text("hi")
         run("git add .")
         run("git commit --no-gpg-sign -m Initial")
@@ -625,9 +669,10 @@
 @pytest.mark.skipif(is_git_legacy(), reason="Requires non-legacy Git")
 def test__version__from_git__initial_commit_empty_and_tagged(tmp_path) -> None:
     run = make_run_callback(tmp_path)
+    b = "master"
 
     with chdir(tmp_path):
-        run("git init")
+        git_init(run, b)
         run("git commit --no-gpg-sign --allow-empty -m Initial")
         run("git tag --no-sign v0.1.0 -m Release")
         assert run("dunamai from git") == "0.1.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dunamai-1.26.2/tests/unit/test_dunamai.py 
new/dunamai-1.26.4/tests/unit/test_dunamai.py
--- old/dunamai-1.26.2/tests/unit/test_dunamai.py       1970-01-01 
01:00:00.000000000 +0100
+++ new/dunamai-1.26.4/tests/unit/test_dunamai.py       1970-01-01 
01:00:00.000000000 +0100
@@ -436,6 +436,8 @@
     assert Version("1.2.3").bump(0).serialize() == "2.0.0"
     assert Version("1.2.3", stage=("a", None)).bump().serialize() == "1.2.3a2"
     assert Version("1.2.3", stage=("a", 4)).bump().serialize() == "1.2.3a5"
+    assert Version("1.2.3", stage=("a", None)).bump(increment=3).serialize() 
== "1.2.3a4"
+    assert Version("1.2.3", stage=("a", 4)).bump(increment=3).serialize() == 
"1.2.3a7"
 
     assert Version("1.2.3", distance=0).bump(smart=False).serialize() == 
"1.2.4"
     assert Version("1.2.3", distance=0).bump(smart=True).serialize() == "1.2.3"

Reply via email to