diff --git a/bumpchanges/utils.py b/bumpchanges/utils.py index fce22d8..cbc44c9 100644 --- a/bumpchanges/utils.py +++ b/bumpchanges/utils.py @@ -8,6 +8,7 @@ from collections import defaultdict from dataclasses import dataclass from pathlib import Path +from typing import Union import semver @@ -39,7 +40,7 @@ def tag_to_semver(tag: str) -> semver.version.Version: return semver.Version.parse(tag[1:]) -def version_to_tag_str(version: str | semver.version.Version) -> str: +def version_to_tag_str(version: Union[str, semver.version.Version]) -> str: """Return the git tag associated with this version.""" # _Do_ add leading `v`s. Versions numbers never have leading `v`s, tags # always have leading `v`s. diff --git a/tests/test_aliases.py b/tests/test_aliases.py index c6d3726..738ae8e 100644 --- a/tests/test_aliases.py +++ b/tests/test_aliases.py @@ -52,6 +52,8 @@ def test_alias_workflow(aliaser): def test_modified_releases(aliaser): """Test how new releases interact with the results.""" + # pylint: disable=protected-access + assert aliaser.compute_alias_action(2) == ("v2", "v2.1.0") # Act as if this GitHub release never existed @@ -90,6 +92,8 @@ def test_modified_releases(aliaser): @pytest.mark.parametrize("release_pre", [True, False]) def test_drafts_and_prereleases(aliaser, semver_pre, release_draft, release_pre): """Test that only non-drafts and full releases are eligible.""" + # pylint: disable=protected-access + base_version = semver.Version(3, 0, 0) if semver_pre: base_version = base_version.bump_prerelease()