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

Avoid passing an emptry string as the tag_regex parameter to setuptools_scm.get_version #68

Merged

Conversation

edgarrmondragon
Copy link
Contributor

Closes #67

@edgarrmondragon edgarrmondragon marked this pull request as draft July 1, 2024 20:35
@edgarrmondragon edgarrmondragon changed the title Use default setuptools-scm value for tag-pattern instead of empty string Avoid passing an emptry string as the tag_regex parameter of setuptools_scm.get_version Jul 1, 2024
@edgarrmondragon edgarrmondragon changed the title Avoid passing an emptry string as the tag_regex parameter of setuptools_scm.get_version Avoid passing an emptry string as the tag_regex parameter to setuptools_scm.get_version Jul 1, 2024
@edgarrmondragon edgarrmondragon force-pushed the tag-pattern-setuptools-scm-default-value branch 2 times, most recently from d9e5a1e to 8971d8a Compare July 1, 2024 20:53
@edgarrmondragon edgarrmondragon force-pushed the tag-pattern-setuptools-scm-default-value branch from 8971d8a to 644b478 Compare July 1, 2024 20:57
@@ -86,7 +86,7 @@ def create_project(directory, metadata, *, setup_vcs=True, nested=False):
git('config', '--local', 'user.email', 'foo@bar.baz')
git('add', '.')
git('commit', '-m', 'test')
git('tag', '1.2.3')
git('tag', '1.2.3', '-m', 'test')
Copy link
Contributor Author

@edgarrmondragon edgarrmondragon Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code was causing tests to hang for me locally, so let me know if this is ok or I should revert it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's log a follow up to investigate

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please let's add a todo comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edgarrmondragon edgarrmondragon marked this pull request as ready for review July 1, 2024 21:14
@RonnyPfannschmidt
Copy link
Collaborator

@ofek should I apply the necessary changes for tool changes in a separate mr or can this get in whole?

1 similar comment
@RonnyPfannschmidt

This comment was marked as duplicate.

@ofek
Copy link
Owner

ofek commented Jul 2, 2024

it's fine to do it here I think

@@ -53,7 +53,9 @@ def construct_setuptools_scm_config(self):
config = deepcopy(self.config_raw_options)
config.setdefault('root', self.root)

config.setdefault('tag_regex', self.config_tag_pattern)
# Only set for non-empty strings
if self.config_tag_pattern:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe instead of setdefault the normal setitem operation should be used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

80a8191 I also added a test that goes into the if block

Copy link
Owner

@ofek ofek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ofek ofek merged commit 48e8aba into ofek:master Jul 2, 2024
15 checks passed
@edgarrmondragon edgarrmondragon deleted the tag-pattern-setuptools-scm-default-value branch July 2, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setuptools-scm warning raised when tag-pattern is not defined
3 participants