Skip to content

Commit eb89275

Browse files
committed
Deprecate get_branch_tags function
1 parent 642cb3e commit eb89275

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

CHANGELOG.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,34 @@ Changelog
1313

1414
Drop Python 3.3 and 3.4 support
1515

16+
.. change::
17+
:tags: general, deprecated
18+
19+
Python 2.7, 3.5 and 3.6 support is deprecated due to their end of life.
20+
21+
It will be completely removed in ``2.0.0`` release. A warning message is added
22+
23+
.. change::
24+
:tags: core, deprecated
25+
26+
``get_branch_tags`` function is renamed to ``get_tags``.
27+
28+
It will be removed in ``2.0.0`` release. A warning message is added
29+
1630
.. change::
1731
:tags: config, deprecated
1832

1933
``version_config`` keyword in ``setup.py`` is renamed to ``setuptools_git_versioning``.
2034

21-
It will be removed in ``2.0`` version. A warning message is added
35+
It will be removed in ``2.0.0`` release. A warning message is added
2236

2337
.. change::
24-
:tags: general, deprecated
38+
:tags: config, deprecated
2539

26-
Python 2.7, 3.5 and 3.6 support is deprecated due to their end of life.
40+
Prefer using ``"enabled": True`` / ``"enabled": False`` option
41+
instead of pure boolean values (``True``, ``False``) for config.
2742

28-
It will be completely removed in ``2.0`` version. A warning message is added
43+
Old behavior is deprecated and will be removed in ``2.0`` version. A warning message is added
2944

3045
.. change::
3146
:tags: core, feature
@@ -77,15 +92,6 @@ Changelog
7792

7893
Added CHANGELOG.rst
7994

80-
.. change::
81-
:tags: config, deprecated
82-
83-
Prefer using ``"enabled": True`` / ``"enabled": False`` option
84-
instead of pure boolean values (``True``, ``False``) for config.
85-
86-
87-
Old behavior is deprecated and will be removed in ``2.0`` version. A warning message is added
88-
8995
.. change::
9096
:tags: docs
9197

setuptools_git_versioning.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,25 @@ def get_all_tags(sort_by=DEFAULT_SORT_BY): # type: (str) -> List[str]
6969
return []
7070

7171

72-
def get_branch_tags(sort_by=DEFAULT_SORT_BY): # type: (str) -> List[str]
72+
def get_branch_tags(*args, **kwargs): # type: (*str, **str) -> List[str]
73+
warnings.warn(
74+
"`get_tags` function is deprecated "
75+
"since setuptools-git-versioning v1.8.0 "
76+
"and will be dropped in v2.0.0\n"
77+
"Please use `get_tags` instead",
78+
category=UserWarning,
79+
)
80+
81+
return get_tags(*args, **kwargs)
82+
83+
84+
def get_tags(sort_by=DEFAULT_SORT_BY): # type: (str) -> List[str]
7385
tags = _exec("git tag --sort=-{} --merged".format(sort_by))
7486
if tags:
7587
return tags
7688
return []
7789

7890

79-
def get_tags(*args, **kwargs): # type: (*str, **str) -> List[str]
80-
return get_branch_tags(*args, **kwargs)
81-
82-
8391
def get_tag(*args, **kwargs): # type: (*str, **str) -> Optional[str]
8492
tags = get_branch_tags(*args, **kwargs)
8593
if tags:

0 commit comments

Comments
 (0)