Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setuptools-scm warning raised when tag-pattern is not defined #67

Closed
edgarrmondragon opened this issue Jul 1, 2024 · 1 comment · Fixed by #68
Closed

setuptools-scm warning raised when tag-pattern is not defined #67

edgarrmondragon opened this issue Jul 1, 2024 · 1 comment · Fixed by #68

Comments

@edgarrmondragon
Copy link
Contributor

edgarrmondragon commented Jul 1, 2024

This package defaults to an empty string when tag-pattern is not defined by the user:

@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):
raise TypeError('option `tag-pattern` must be a string')
self.__config_tag_pattern = tag_pattern
return self.__config_tag_pattern

This is causing setuptools-scm to raise a deprecation warning:

DeprecationWarning: Error getting the version from source `vcs`: empty regex for tag regex is invalid, using default

This warning is coming from https://github.com/pypa/setuptools_scm/blob/102f56a896bc4ea8d4c58d9c49f455f15310de38/src/setuptools_scm/_get_version_impl.py#L167-L175.

I don't know what the best solution is (if one's really needed) other than repeating setuptools_scm's default string value in this codebase.

@ofek
Copy link
Owner

ofek commented Jul 1, 2024

Could we import the default value? I'm definitely open to PRs!

edgarrmondragon added a commit to edgarrmondragon/hatch-vcs that referenced this issue Jul 1, 2024
edgarrmondragon added a commit to edgarrmondragon/hatch-vcs that referenced this issue Jul 1, 2024
edgarrmondragon added a commit to edgarrmondragon/hatch-vcs that referenced this issue Jul 1, 2024
edgarrmondragon added a commit to edgarrmondragon/hatch-vcs that referenced this issue Jul 1, 2024
@ofek ofek closed this as completed in #68 Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants