Skip to content

Commit

Permalink
Use default setuptools-scm value for tag-pattern instead of empty s…
Browse files Browse the repository at this point in the history
…tring

Closes ofek#67
  • Loading branch information
edgarrmondragon committed Jul 1, 2024
1 parent e186a8b commit 4975a19
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hatch_vcs/version_source.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# SPDX-FileCopyrightText: 2022-present Ofek Lev <oss@ofek.dev>
#
# SPDX-License-Identifier: MIT
import re

from hatchling.version.source.plugin.interface import VersionSourceInterface


Expand All @@ -17,8 +19,9 @@ def __init__(self, *args, **kwargs):
@property
def config_tag_pattern(self):
if self.__config_tag_pattern is None:
tag_pattern = self.config.get('tag-pattern', '')
if not isinstance(tag_pattern, str):
from setuptools_scm import _config
tag_pattern = self.config.get('tag-pattern', _config.DEFAULT_TAG_REGEX)
if not isinstance(tag_pattern, (str, re.Pattern)):
raise TypeError('option `tag-pattern` must be a string')

self.__config_tag_pattern = tag_pattern
Expand Down

0 comments on commit 4975a19

Please sign in to comment.