Skip to content

Commit

Permalink
Deprecate get_branch_tags function
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Jan 7, 2022
1 parent 642cb3e commit eb89275
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
32 changes: 19 additions & 13 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,34 @@ Changelog

Drop Python 3.3 and 3.4 support

.. change::
:tags: general, deprecated

Python 2.7, 3.5 and 3.6 support is deprecated due to their end of life.

It will be completely removed in ``2.0.0`` release. A warning message is added

.. change::
:tags: core, deprecated

``get_branch_tags`` function is renamed to ``get_tags``.

It will be removed in ``2.0.0`` release. A warning message is added

.. change::
:tags: config, deprecated

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

It will be removed in ``2.0`` version. A warning message is added
It will be removed in ``2.0.0`` release. A warning message is added

.. change::
:tags: general, deprecated
:tags: config, deprecated

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

It will be completely removed in ``2.0`` version. A warning message is added
Old behavior is deprecated and will be removed in ``2.0`` version. A warning message is added

.. change::
:tags: core, feature
Expand Down Expand Up @@ -77,15 +92,6 @@ Changelog

Added CHANGELOG.rst

.. change::
:tags: config, deprecated

Prefer using ``"enabled": True`` / ``"enabled": False`` option
instead of pure boolean values (``True``, ``False``) for config.


Old behavior is deprecated and will be removed in ``2.0`` version. A warning message is added

.. change::
:tags: docs

Expand Down
18 changes: 13 additions & 5 deletions setuptools_git_versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,25 @@ def get_all_tags(sort_by=DEFAULT_SORT_BY): # type: (str) -> List[str]
return []


def get_branch_tags(sort_by=DEFAULT_SORT_BY): # type: (str) -> List[str]
def get_branch_tags(*args, **kwargs): # type: (*str, **str) -> List[str]
warnings.warn(
"`get_tags` function is deprecated "
"since setuptools-git-versioning v1.8.0 "
"and will be dropped in v2.0.0\n"
"Please use `get_tags` instead",
category=UserWarning,
)

return get_tags(*args, **kwargs)


def get_tags(sort_by=DEFAULT_SORT_BY): # type: (str) -> List[str]
tags = _exec("git tag --sort=-{} --merged".format(sort_by))
if tags:
return tags
return []


def get_tags(*args, **kwargs): # type: (*str, **str) -> List[str]
return get_branch_tags(*args, **kwargs)


def get_tag(*args, **kwargs): # type: (*str, **str) -> Optional[str]
tags = get_branch_tags(*args, **kwargs)
if tags:
Expand Down

0 comments on commit eb89275

Please sign in to comment.