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-02-23 16:13:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-dunamai (Old) and /work/SRC/openSUSE:Factory/.python-dunamai.new.1977 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-dunamai" Mon Feb 23 16:13:39 2026 rev:13 rq:1334516 version:1.26.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-dunamai/python-dunamai.changes 2025-07-06 17:19:42.004220418 +0200 +++ /work/SRC/openSUSE:Factory/.python-dunamai.new.1977/python-dunamai.changes 2026-02-23 16:15:40.557068406 +0100 @@ -1,0 +2,7 @@ +Mon Feb 23 13:55:02 UTC 2026 - Richard Rahl <[email protected]> + +- Update to version 1.26.0: + * Added --highest-tag option to select the numerically highest version, even + if it is not the chronologically latest tag + +------------------------------------------------------------------- Old: ---- python-dunamai-1.25.0.tar.gz New: ---- python-dunamai-1.26.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-dunamai.spec ++++++ --- /var/tmp/diff_new_pack.RSJ2AS/_old 2026-02-23 16:15:41.029087869 +0100 +++ /var/tmp/diff_new_pack.RSJ2AS/_new 2026-02-23 16:15:41.037088198 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-dunamai # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-dunamai -Version: 1.25.0 +Version: 1.26.0 Release: 0 Summary: Dynamic version generation License: MIT ++++++ python-dunamai-1.25.0.tar.gz -> python-dunamai-1.26.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/CHANGELOG.md new/dunamai-1.26.0/CHANGELOG.md --- old/dunamai-1.25.0/CHANGELOG.md 2025-07-04 21:18:20.448830600 +0200 +++ new/dunamai-1.26.0/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +1,8 @@ +## v1.26.0 (2026-02-14) + +* Added `--highest-tag` option to select the numerically highest version, + even if it is not the chronologically latest tag. + ## v1.25.0 (2025-07-04) * Added `commit_prefix` option to `Version.serialize()` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/PKG-INFO new/dunamai-1.26.0/PKG-INFO --- old/dunamai-1.25.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/dunamai-1.26.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +1,9 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.4 Name: dunamai -Version: 1.25.0 +Version: 1.26.0 Summary: Dynamic version generation -Home-page: https://github.com/mtkennerly/dunamai License: MIT +License-File: LICENSE Keywords: version,versioning,dynamic Author: Matthew T. Kennerly Author-email: [email protected] @@ -23,6 +23,7 @@ Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 Requires-Dist: importlib-metadata (>=1.6.0) ; python_version < "3.8" Requires-Dist: packaging (>=20.9) Project-URL: Repository, https://github.com/mtkennerly/dunamai diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/dunamai/__init__.py new/dunamai-1.26.0/dunamai/__init__.py --- old/dunamai-1.25.0/dunamai/__init__.py 2025-07-03 06:04:33.767532300 +0200 +++ new/dunamai-1.26.0/dunamai/__init__.py 1970-01-01 01:00:00.000000000 +0100 @@ -240,6 +240,7 @@ pattern: Union[str, Pattern], sources: Sequence[str], latest_source: bool, + highest_source: bool, strict: bool, pattern_prefix: Optional[str], ) -> Optional[_MatchedVersionPattern]: @@ -262,7 +263,24 @@ pattern = Pattern.parse(pattern, pattern_prefix) - for source in sources[:1] if latest_source else sources: + if latest_source: + relevant_sources = sources[:1] + elif highest_source: + selected_source = None + selected_parsed = None + for source in sources: + parsed = Version.parse(source, pattern) + try: + if selected_parsed is None or parsed > selected_parsed: + selected_source = source + selected_parsed = parsed + except Exception: + continue + relevant_sources = [selected_source] if selected_source is not None else [] + else: + relevant_sources = sources + + for source in relevant_sources: try: pattern_match = re.search(pattern, source) except re.error as e: @@ -884,7 +902,9 @@ failed = False try: - matched_pattern = _match_version_pattern(pattern, [normalized], True, strict=True, pattern_prefix=None) + matched_pattern = _match_version_pattern( + pattern, [normalized], True, False, strict=True, pattern_prefix=None + ) except ValueError: failed = True @@ -1036,6 +1056,7 @@ pattern_prefix: Optional[str] = None, ignore_untracked: bool = False, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": r""" Determine a version based on Git tags. @@ -1056,6 +1077,8 @@ Ignore untracked files when determining whether the repository is dirty. :param commit_length: Use this many characters from the start of the full commit hash. + :param highest_tag: + Only inspect the numerically highest tag across all tagged commits for a pattern match. :returns: Detected version. """ vcs = Vcs.Git @@ -1114,7 +1137,9 @@ vcs=vcs, ) - matched_pattern = _match_version_pattern(pattern, [tag], latest_tag, strict, pattern_prefix) + matched_pattern = _match_version_pattern( + pattern, [tag], latest_tag, highest_tag, strict, pattern_prefix + ) if matched_pattern is None: return cls._fallback( strict, @@ -1215,7 +1240,7 @@ vcs=vcs, ) tags = [line.replace("refs/tags/", "") for line in msg.splitlines()] - matched_pattern = _match_version_pattern(pattern, tags, latest_tag, strict, pattern_prefix) + matched_pattern = _match_version_pattern(pattern, tags, latest_tag, highest_tag, strict, pattern_prefix) else: code, msg = _run_cmd( 'git for-each-ref "refs/tags/**" --merged {}'.format(tag_branch) + ' --format "%(refname)' @@ -1254,7 +1279,7 @@ detailed_tags.append(_GitRefInfo(*parts).with_tag_topo_lookup(tag_topo_lookup)) tags = [t.ref() for t in sorted(detailed_tags, key=lambda x: x.sort_key(), reverse=True)] - matched_pattern = _match_version_pattern(pattern, tags, latest_tag, strict, pattern_prefix) + matched_pattern = _match_version_pattern(pattern, tags, latest_tag, highest_tag, strict, pattern_prefix) if matched_pattern is None: try: @@ -1305,6 +1330,7 @@ path: Optional[Path] = None, pattern_prefix: Optional[str] = None, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": r""" Determine a version based on Mercurial tags. @@ -1321,6 +1347,8 @@ :param pattern_prefix: Insert this after the pattern's start anchor (`^`). :param commit_length: Use this many characters from the start of the full commit hash. + :param highest_tag: + Only inspect the numerically highest tag across all tagged commits for a pattern match. :returns: Detected version. """ vcs = Vcs.Mercurial @@ -1359,7 +1387,7 @@ continue all_tags.append(parts[1]) - matched_pattern = _match_version_pattern(pattern, all_tags, latest_tag, strict, pattern_prefix) + matched_pattern = _match_version_pattern(pattern, all_tags, latest_tag, highest_tag, strict, pattern_prefix) if matched_pattern is None: return cls._fallback( strict, @@ -1421,7 +1449,7 @@ ) tags = [tag for tags in [line.split(":") for line in msg.splitlines()] for tag in tags] - matched_pattern = _match_version_pattern(pattern, tags, latest_tag, strict, pattern_prefix) + matched_pattern = _match_version_pattern(pattern, tags, latest_tag, highest_tag, strict, pattern_prefix) if matched_pattern is None: return cls._fallback( strict, @@ -1463,6 +1491,7 @@ path: Optional[Path] = None, pattern_prefix: Optional[str] = None, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": r""" Determine a version based on Darcs tags. @@ -1478,6 +1507,8 @@ :param pattern_prefix: Insert this after the pattern's start anchor (`^`). :param commit_length: Use this many characters from the start of the full commit hash. + :param highest_tag: + Only inspect the numerically highest tag across all tagged commits for a pattern match. :returns: Detected version. """ vcs = Vcs.Darcs @@ -1507,7 +1538,7 @@ return cls._fallback(strict, distance=distance, commit=commit, dirty=dirty, timestamp=timestamp, vcs=vcs) tags = msg.splitlines() - matched_pattern = _match_version_pattern(pattern, tags, latest_tag, strict, pattern_prefix) + matched_pattern = _match_version_pattern(pattern, tags, latest_tag, highest_tag, strict, pattern_prefix) if matched_pattern is None: return cls._fallback( strict, @@ -1548,6 +1579,7 @@ path: Optional[Path] = None, pattern_prefix: Optional[str] = None, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": r""" Determine a version based on Subversion tags. @@ -1564,6 +1596,8 @@ :param pattern_prefix: Insert this after the pattern's start anchor (`^`). :param commit_length: Use this many characters from the start of the full commit hash. + :param highest_tag: + Only inspect the numerically highest tag across all tagged commits for a pattern match. :returns: Detected version. """ vcs = Vcs.Subversion @@ -1609,7 +1643,7 @@ tags_to_sources_revs[tag] = (source, rev) tags = sorted(tags_to_sources_revs, key=lambda x: tags_to_sources_revs[x], reverse=True) - matched_pattern = _match_version_pattern(pattern, tags, latest_tag, strict, pattern_prefix) + matched_pattern = _match_version_pattern(pattern, tags, latest_tag, highest_tag, strict, pattern_prefix) if matched_pattern is None: return cls._fallback( strict, @@ -1649,6 +1683,7 @@ path: Optional[Path] = None, pattern_prefix: Optional[str] = None, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": r""" Determine a version based on Bazaar tags. @@ -1664,6 +1699,8 @@ :param pattern_prefix: Insert this after the pattern's start anchor (`^`). :param commit_length: Use this many characters from the start of the full commit hash. + :param highest_tag: + Only inspect the numerically highest tag across all tagged commits for a pattern match. :returns: Detected version. """ vcs = Vcs.Bazaar @@ -1707,7 +1744,7 @@ tags_to_revs = {line.split()[0]: int(line.split()[1]) for line in msg.splitlines() if line.split()[1] != "?"} tags = [x[1] for x in sorted([(v, k) for k, v in tags_to_revs.items()], reverse=True)] - matched_pattern = _match_version_pattern(pattern, tags, latest_tag, strict, pattern_prefix) + matched_pattern = _match_version_pattern(pattern, tags, latest_tag, highest_tag, strict, pattern_prefix) if matched_pattern is None: return cls._fallback( strict, @@ -1747,6 +1784,7 @@ path: Optional[Path] = None, pattern_prefix: Optional[str] = None, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": r""" Determine a version based on Fossil tags. @@ -1761,6 +1799,8 @@ :param pattern_prefix: Insert this after the pattern's start anchor (`^`). :param commit_length: Use this many characters from the start of the full commit hash. + :param highest_tag: + Only inspect the numerically highest tag across all tagged commits for a pattern match. :returns: Detected version. """ vcs = Vcs.Fossil @@ -1843,7 +1883,7 @@ ] matched_pattern = _match_version_pattern( - pattern, [t for t, d in tags_to_distance], latest_tag, strict, pattern_prefix + pattern, [t for t, d in tags_to_distance], latest_tag, highest_tag, strict, pattern_prefix ) if matched_pattern is None: return cls._fallback( @@ -1884,6 +1924,7 @@ path: Optional[Path] = None, pattern_prefix: Optional[str] = None, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": r""" Determine a version based on Pijul tags. @@ -1899,6 +1940,8 @@ :param pattern_prefix: Insert this after the pattern's start anchor (`^`). :param commit_length: Use this many characters from the start of the full commit hash. + :param highest_tag: + Only inspect the numerically highest tag across all tagged commits for a pattern match. :returns: Detected version. """ vcs = Vcs.Pijul @@ -1984,7 +2027,7 @@ tags = [t["message"] for t in sorted(tag_meta_by_msg.values(), key=lambda x: x["timestamp"], reverse=True)] - matched_pattern = _match_version_pattern(pattern, tags, latest_tag, strict, pattern_prefix) + matched_pattern = _match_version_pattern(pattern, tags, latest_tag, highest_tag, strict, pattern_prefix) if matched_pattern is None: return cls._fallback( strict, @@ -2036,6 +2079,7 @@ pattern_prefix: Optional[str] = None, ignore_untracked: bool = False, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": r""" Determine a version based on a detected version control system. @@ -2070,6 +2114,8 @@ This is only used for Git currently. :param commit_length: Use this many characters from the start of the full commit hash. + :param highest_tag: + Only inspect the numerically highest tag across all tagged commits for a pattern match. :returns: Detected version. """ vcs = _detect_vcs_from_archival(path) @@ -2103,6 +2149,7 @@ pattern_prefix: Optional[str] = None, ignore_untracked: bool = False, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": r""" Determine a version based on a specific VCS setting. @@ -2131,6 +2178,8 @@ This is only used for Git currently. :param commit_length: Use this many characters from the start of the full commit hash. + :param highest_tag: + Only inspect the numerically highest tag across all tagged commits for a pattern match. :returns: Detected version. """ return cls._do_vcs_callback( @@ -2145,6 +2194,7 @@ pattern_prefix, ignore_untracked, commit_length, + highest_tag, ) @classmethod @@ -2161,6 +2211,7 @@ pattern_prefix: Optional[str] = None, ignore_untracked: bool = False, commit_length: Optional[int] = None, + highest_tag: bool = False, ) -> "Version": mapping = { Vcs.Any: cls.from_any_vcs, @@ -2185,6 +2236,7 @@ ("pattern_prefix", pattern_prefix), ("ignore_untracked", ignore_untracked), ("commit_length", commit_length), + ("highest_tag", highest_tag), ]: if kwarg in inspect.getfullargspec(callback).args: kwargs[kwarg] = value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/dunamai/__main__.py new/dunamai-1.26.0/dunamai/__main__.py --- old/dunamai-1.25.0/dunamai/__main__.py 2025-07-04 21:16:18.246422800 +0200 +++ new/dunamai-1.26.0/dunamai/__main__.py 1970-01-01 01:00:00.000000000 +0100 @@ -88,6 +88,13 @@ "help": "Only inspect the latest tag on the latest tagged commit for a pattern match", }, { + "triggers": ["--highest-tag"], + "action": "store_true", + "dest": "highest_tag", + "default": False, + "help": "Only inspect the numerically highest tag across all tagged commits for a pattern match", + }, + { "triggers": ["--strict"], "action": "store_true", "dest": "strict", @@ -292,6 +299,7 @@ commit_length: Optional[int], commit_prefix: Optional[str], escape_with: Optional[str], + highest_tag: bool, ) -> None: version = Version.from_vcs( vcs, @@ -305,6 +313,7 @@ pattern_prefix, ignore_untracked, commit_length, + highest_tag, ) for concern in version.concerns: @@ -349,6 +358,7 @@ commit_length, commit_prefix, escape_with, + args.highest_tag, ) elif args.command == "check": version = from_stdin(args.version) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/pyproject.toml new/dunamai-1.26.0/pyproject.toml --- old/dunamai-1.25.0/pyproject.toml 2025-07-04 21:18:20.448830600 +0200 +++ new/dunamai-1.26.0/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ [tool.poetry] name = "dunamai" -version = "1.25.0" +version = "1.26.0" description = "Dynamic version generation" license = "MIT" authors = ["Matthew T. Kennerly <[email protected]>"] @@ -25,7 +25,7 @@ packaging = ">=20.9" # 20.9 is the last with Python 3.5 compat importlib-metadata = {version = ">=1.6.0", python = "<3.8"} # 2.1.1 is the last with Python 3.5 compat -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] pytest = [ { version = "^7.2", python = "^3.7" }, { version = "^3.0", python = ">=3.5,<3.7" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/tests/archival/git-tagged/.git_archival.json new/dunamai-1.26.0/tests/archival/git-tagged/.git_archival.json --- old/dunamai-1.25.0/tests/archival/git-tagged/.git_archival.json 2022-11-07 00:17:43.042640700 +0100 +++ new/dunamai-1.26.0/tests/archival/git-tagged/.git_archival.json 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ -{ - "hash-full": "8fe614dbf9e767e70442ab8f56e99bd08d7e782d", - "hash-short": "8fe614d", - "timestamp": "2022-11-07T07:07:50+08:00", - "refs": "HEAD -> master, feature/foo", - "describe": "v0.1.0" -} +{ + "hash-full": "8fe614dbf9e767e70442ab8f56e99bd08d7e782d", + "hash-short": "8fe614d", + "timestamp": "2022-11-07T07:07:50+08:00", + "refs": "HEAD -> master, feature/foo", + "describe": "v0.1.0" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/tests/archival/git-tagged-post/.git_archival.json new/dunamai-1.26.0/tests/archival/git-tagged-post/.git_archival.json --- old/dunamai-1.25.0/tests/archival/git-tagged-post/.git_archival.json 2022-11-07 00:17:36.192260300 +0100 +++ new/dunamai-1.26.0/tests/archival/git-tagged-post/.git_archival.json 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ -{ - "hash-full": "1b57ff77e01728b301088b9d57e3922d156c7ec3", - "hash-short": "1b57ff7", - "timestamp": "2022-11-07T07:16:59+08:00", - "refs": "HEAD -> master", - "describe": "v0.1.0-1-g1b57ff7" -} +{ + "hash-full": "1b57ff77e01728b301088b9d57e3922d156c7ec3", + "hash-short": "1b57ff7", + "timestamp": "2022-11-07T07:16:59+08:00", + "refs": "HEAD -> master", + "describe": "v0.1.0-1-g1b57ff7" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/tests/archival/git-untagged/.git_archival.json new/dunamai-1.26.0/tests/archival/git-untagged/.git_archival.json --- old/dunamai-1.25.0/tests/archival/git-untagged/.git_archival.json 2022-11-07 00:56:07.890708400 +0100 +++ new/dunamai-1.26.0/tests/archival/git-untagged/.git_archival.json 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ -{ - "hash-full": "8fe614dbf9e767e70442ab8f56e99bd08d7e782d", - "hash-short": "8fe614d", - "timestamp": "2022-11-07T07:07:50+08:00", - "refs": "HEAD -> master, feature/foo", - "describe": "" -} +{ + "hash-full": "8fe614dbf9e767e70442ab8f56e99bd08d7e782d", + "hash-short": "8fe614d", + "timestamp": "2022-11-07T07:07:50+08:00", + "refs": "HEAD -> master, feature/foo", + "describe": "" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/tests/archival/hg-untagged/.hg_archival.txt new/dunamai-1.26.0/tests/archival/hg-untagged/.hg_archival.txt --- old/dunamai-1.25.0/tests/archival/hg-untagged/.hg_archival.txt 2022-11-06 10:45:14.488842500 +0100 +++ new/dunamai-1.26.0/tests/archival/hg-untagged/.hg_archival.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ -repo: 25e474af1332ed4fff9351c70ef8f36352c013f2 -node: 25e474af1332ed4fff9351c70ef8f36352c013f2 -branch: default -latesttag: null -latesttagdistance: 1 -changessincelatesttag: 1 +repo: 25e474af1332ed4fff9351c70ef8f36352c013f2 +node: 25e474af1332ed4fff9351c70ef8f36352c013f2 +branch: default +latesttag: null +latesttagdistance: 1 +changessincelatesttag: 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/tests/integration/test_dunamai.py new/dunamai-1.26.0/tests/integration/test_dunamai.py --- old/dunamai-1.25.0/tests/integration/test_dunamai.py 2025-05-07 04:16:08.799264200 +0200 +++ new/dunamai-1.26.0/tests/integration/test_dunamai.py 1970-01-01 01:00:00.000000000 +0100 @@ -128,13 +128,13 @@ # Additional one-off check not in other VCS integration tests: # when the only tag in the repository does not match the pattern. - run("git tag other -m Annotated") + run("git tag --no-sign other -m Annotated") assert from_vcs() == Version("0.0.0", distance=1, dirty=False, branch=b) with pytest.raises(ValueError): from_vcs(strict=True) avoid_identical_ref_timestamps() - run("git tag v0.1.0 -m Annotated") + run("git tag --no-sign v0.1.0 -m Annotated") assert from_vcs() == Version("0.1.0", dirty=False, branch=b) assert from_vcs(latest_tag=True) == Version("0.1.0", dirty=False, branch=b) assert run("dunamai from git") == "0.1.0" @@ -158,7 +158,7 @@ if not legacy: # Verify tags with '/' work - run("git tag test/v0.1.0") + run("git tag --no-sign test/v0.1.0") assert run(r'dunamai from any --pattern "^test/v(?P<base>\d\.\d\.\d)"') == "0.1.0" assert run('dunamai from any --pattern-prefix "test/"') == "0.1.0" @@ -170,22 +170,22 @@ assert from_vcs() == Version("0.1.0", distance=1, dirty=False, branch=b) assert from_any_vcs() == Version("0.1.0", distance=1, dirty=False, branch=b) - run("git tag unmatched -m Annotated") + run("git tag --no-sign unmatched -m Annotated") assert from_vcs() == Version("0.1.0", distance=1, dirty=False, branch=b) with pytest.raises(ValueError): from_vcs(latest_tag=True) # check that we find the expected tag that has the most recent tag creation time if legacy: - run("git tag -d unmatched") - run("git tag v0.2.0 -m Annotated") + run("git tag --no-sign -d unmatched") + run("git tag --no-sign v0.2.0 -m Annotated") if not legacy: avoid_identical_ref_timestamps() - run("git tag v0.2.0b1 -m Annotated") + run("git tag --no-sign v0.2.0b1 -m Annotated") avoid_identical_ref_timestamps() - run("git tag v0.2.0 -m Annotated") + run("git tag --no-sign v0.2.0 -m Annotated") avoid_identical_ref_timestamps() - run("git tag v0.1.1 HEAD~1 -m Annotated") + run("git tag --no-sign v0.1.1 HEAD~1 -m Annotated") assert from_vcs() == Version("0.2.0", dirty=False, branch=b) assert from_vcs(latest_tag=True) == Version("0.2.0", dirty=False, branch=b) @@ -209,7 +209,7 @@ assert run("dunamai from any --bump") == "0.2.1.dev1+{}".format(commit) if not legacy: # tag with pre-release segment. - run("git tag v0.2.1b3 -m Annotated") + run("git tag --no-sign v0.2.1b3 -m Annotated") assert from_vcs() == Version("0.2.1", stage=("b", 3), dirty=False, branch=b) if not legacy: @@ -217,11 +217,17 @@ (tmp_path / "foo.txt").write_text("fourth") run("git add .") run('git commit --no-gpg-sign -m "Fourth"') - run("git tag v0.3.0+a,b -m Annotated") + run("git tag --no-sign v0.3.0+a,b -m Annotated") assert from_vcs() == Version("0.3.0", dirty=False, tagged_metadata="a,b", branch=b) + # Checking `highest_tag` + run("git checkout master") + run("git tag --no-sign v0.2.9 -m Annotated") + assert from_vcs(latest_tag=True) == Version("0.2.9", dirty=False, branch=b) + assert from_vcs(highest_tag=True) == Version("0.3.0", dirty=False, tagged_metadata="a,b", branch=b) + if not legacy: - assert from_vcs(path=tmp_path) == Version("0.3.0", dirty=False, tagged_metadata="a,b", branch=b) + assert from_vcs(path=tmp_path) == Version("0.2.9", dirty=False, branch=b) @pytest.mark.skipif(shutil.which("git") is None, reason="Requires Git") @@ -237,7 +243,7 @@ run("git add .") run('git commit --no-gpg-sign -m "Initial commit"') - run("git tag v0.1.0") + run("git tag --no-sign v0.1.0") assert from_vcs() == Version("0.1.0", dirty=False, branch=b) assert from_vcs(latest_tag=True) == Version("0.1.0", dirty=False, branch=b) assert run("dunamai from git") == "0.1.0" @@ -257,8 +263,8 @@ assert from_vcs() == Version("0.1.0", distance=2, dirty=False, branch=b) assert from_any_vcs() == Version("0.1.0", distance=2, dirty=False, branch=b) - run("git tag v0.2.0") - run("git tag v0.1.1 HEAD~1") + run("git tag --no-sign v0.2.0") + run("git tag --no-sign v0.1.1 HEAD~1") assert from_vcs() == Version("0.2.0", dirty=False, branch=b) assert from_vcs(latest_tag=True) == Version("0.2.0", dirty=False, branch=b) @@ -267,6 +273,11 @@ assert from_vcs() == Version("0.1.1", dirty=False) assert from_vcs(latest_tag=True) == Version("0.1.1", dirty=False) + # Checking `highest_tag` + run("git checkout master") + run("git tag --no-sign v0.1.2") + assert from_vcs(highest_tag=True) == Version("0.2.0", dirty=False, branch=b) + @pytest.mark.skipif(shutil.which("git") is None, reason="Requires Git") def test__version__from_git__with_mixed_tags(tmp_path) -> None: @@ -280,7 +291,7 @@ run("git add .") run('git commit --no-gpg-sign -m "Initial commit"') - run("git tag v0.1.0") + run("git tag --no-sign v0.1.0") (tmp_path / "foo.txt").write_text("hi 2") run("git add .") avoid_identical_ref_timestamps() @@ -295,7 +306,7 @@ avoid_identical_ref_timestamps() run('git commit --no-gpg-sign -m "Third"') - run("git tag v0.3.0") + run("git tag --no-sign v0.3.0") assert from_vcs() == Version("0.3.0", dirty=False, branch=b) assert from_vcs(latest_tag=True) == Version("0.3.0", dirty=False, branch=b) @@ -320,7 +331,7 @@ }, ) - run("git tag v0.1.0") + run("git tag --no-sign v0.1.0") (tmp_path / "foo.txt").write_text("hi 2") run("git add .") avoid_identical_ref_timestamps() @@ -333,7 +344,7 @@ }, ) - run("git tag v0.2.0") + run("git tag --no-sign v0.2.0") if legacy: assert from_vcs() == Version("0.1.0", distance=1, dirty=False, branch=b) else: @@ -353,7 +364,7 @@ (tmp_path / "foo.txt").write_text("hi") run("git add .") run("git commit --no-gpg-sign -m Initial") - run("git tag v0.1.0 -m Release") + run("git tag --no-sign v0.1.0 -m Release") run("git checkout -b develop") (tmp_path / "foo.txt").write_text("second") @@ -371,7 +382,7 @@ run("git checkout master") run("git merge --no-gpg-sign --no-ff release/v0.2.0") - run("git tag v0.2.0 -m Release") + run("git tag --no-sign v0.2.0 -m Release") assert from_vcs() == Version("0.2.0", dirty=False, branch=b) run("git checkout develop") @@ -466,7 +477,7 @@ (tmp_path / "foo.txt").write_text("hi") run("git add .") run("git commit --no-gpg-sign -m Initial") - run("git tag v0.1.0 -m Release") + run("git tag --no-sign v0.1.0 -m Release") assert run("dunamai from git", env=env) == "0.1.0" @@ -481,7 +492,7 @@ (tmp_path / "foo.txt").write_text("hi") run("git add .") run("git commit --no-gpg-sign -m Initial") - run("git tag v0.1.0 -m Release") + run("git tag --no-sign v0.1.0 -m Release") run("git config log.excludeDecoration refs/tags/") assert from_vcs() == Version("0.1.0", dirty=False, branch=b) @@ -500,7 +511,7 @@ (tmp_path / "foo.txt").write_text("hi") run("git add .") run("git commit --no-gpg-sign -m Initial") - run("git tag v0.1.0 -m Release") + run("git tag --no-sign v0.1.0 -m Release") (tmp_path / ".git/refs/tags/bad.txt").touch() assert from_vcs() == Version("0.1.0", dirty=False, branch=b) @@ -514,19 +525,19 @@ with chdir(tmp_path): run("git init") run("git commit --no-gpg-sign --allow-empty -m Initial") - run("git tag v0.1.0 -m Release") + run("git tag --no-sign v0.1.0 -m Release") assert run("dunamai from git") == "0.1.0" run("git commit --no-gpg-sign --allow-empty -m Second") assert run("dunamai from git").startswith("0.1.0.post1.dev0+") - run("git tag v0.2.0 -m Release") + run("git tag --no-sign v0.2.0 -m Release") assert run("dunamai from git") == "0.2.0" (tmp_path / "foo.txt").write_text("hi") run("git add .") run("git commit --no-gpg-sign -m Third") - run("git tag v0.3.0 -m Release") + run("git tag --no-sign v0.3.0 -m Release") assert run("dunamai from git") == "0.3.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dunamai-1.25.0/tests/unit/test_main.py new/dunamai-1.26.0/tests/unit/test_main.py --- old/dunamai-1.25.0/tests/unit/test_main.py 2025-07-04 21:15:35.359509000 +0200 +++ new/dunamai-1.26.0/tests/unit/test_main.py 1970-01-01 01:00:00.000000000 +0100 @@ -29,6 +29,7 @@ commit_length=None, commit_prefix=None, escape_with=None, + highest_tag=False, ) assert parse_args(["from", "git"]).vcs == "git" assert parse_args(["from", "git", "--tag-branch", "foo"]).tag_branch == "foo" @@ -61,6 +62,7 @@ assert parse_args(["from", "any", "--commit-length", "10"]).commit_length == 10 assert parse_args(["from", "any", "--commit-prefix", "x"]).commit_prefix == "x" assert parse_args(["from", "any", "--escape-with", "x"]).escape_with == "x" + assert parse_args(["from", "any", "--highest-tag"]).highest_tag is True assert parse_args(["from", "subversion", "--tag-dir", "foo"]).tag_dir == "foo" with pytest.raises(SystemExit):
