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

Warning tag_filter is not a valid function reference appears if there is no matching tag? #93

Closed
nicholas-russell opened this issue Jan 24, 2024 · 1 comment

Comments

@nicholas-russell
Copy link

I am using this in a monorepo with the following structure:

<root>
app
 └─sub-folder
    └─my-pkg
       └─pyproject.toml

The configuration is

[build-system]
requires = ["setuptools>=61.0", "setuptools-git-versioning"]
build-backend = "setuptools.build_meta"

...

[tool.setuptools-git-versioning]
enabled = true
tag_filter = "my-pkg/(?P<tag>.*)"
tag_formatter = ".*/(?P<tag>.*)"
dev_template = "{tag}+{branch}.{sha}"
dirty_template = "{tag}+{branch}.{sha}.dirty"

Running the command below, without any tag:

~/app/sub-folder/my-pkg$ setuptools-git-versioning
[2024-01-24 15:37:18,569]  WARNING: tag_filter is not a valid function reference: Wrong reference name: my-pkg/(?P<tag>.*)
0.0.1

Now when I do tag something (e.g., my-pkg/1.0.0), it gives me something different

~/app/sub-folder/my-pkg$ setuptools-git-versioning
[2024-01-24 15:38:02,986]  WARNING: tag_filter is not a valid function reference: Wrong reference name: my-pkg/(?P<tag>.*)
[2024-01-24 15:38:03,009]  WARNING: tag_formatter is not a valid function reference: Wrong reference name: .*/(?P<tag>.*)
1.0.0+master.9ff32a07.dirty

If I tag my current commit and have a clean working tree I get below, which is expected, but error messages are confusing. These don't really matter though.

~/app/sub-folder/my-pkg$ git tag my-pkg/1.1.0
~/app/sub-folder/my-pkg$ setuptools-git-versioning
[2024-01-24 15:39:47,446]  WARNING: tag_filter is not a valid function reference: Wrong reference name: my-pkg/(?P<tag>.*)
[2024-01-24 15:39:47,474]  WARNING: tag_formatter is not a valid function reference: Wrong reference name: .*/(?P<tag>.*)
1.1.0

So the crux of the issue is that when there is no tag and a filter, it won't append the VCS info.

dolfinus added a commit that referenced this issue Jan 30, 2024
@dolfinus
Copy link
Owner

Hi.

Please check 1.13.6 release

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

No branches or pull requests

2 participants