Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Poetry complains about no git tag during export or lock #15

Closed
sl304227-nh opened this issue Aug 11, 2021 · 4 comments
Closed

Poetry complains about no git tag during export or lock #15

sl304227-nh opened this issue Aug 11, 2021 · 4 comments

Comments

@sl304227-nh
Copy link

sl304227-nh commented Aug 11, 2021

Would it be possible to bypass this git tag check except and only during a build? We only need it during a build right.

During Dockerfile builds or any other shell commands, it complains about not having a tag for basic poetry commands. It should only complain during a poetry build.

  poetry-version-plugin: No Git tag found, not extracting dynamic version

  at /usr/local/lib/python3.8/site-packages/poetry_version_plugin/plugin.py:106 in activate
      102│                     "poetry-version-plugin: No Git tag found, not "
      103│                     "extracting dynamic version"
      104│                 )
      105│                 io.write_error_line(message)
    → 106│                 raise RuntimeError(message)
      107│ 
@sl304227-nh
Copy link
Author

It appears we could make a boolean in the pyproject.toml file that could help us:

[tool.poetry-version-plugin]
source = "git-tag"
git-tag-check = false

Then in the plugin.py, after checking for exit code, if we get a non-zero, we could simply warning.warn() the message, rather than raise an exception. We could raise the exception if git-tag-check = true of course.

What do you think?

@sl304227-nh
Copy link
Author

I think the most elegant is definitely to only check on poetry build commands, and not on any other command.

@eshwen
Copy link

eshwen commented Jan 8, 2024

I've just discovered this package (which is awesome on the surface) but this issue is proving a dealbreaker for me

System:

  • macOS 14.2.1
  • Python 3.10.13
  • Poetry 1.7.1

Has anybody found a decent workaround, or should I try another package, like https://pypi.org/project/poetry-dynamic-versioning/?

@tiangolo
Copy link
Owner

tiangolo commented Sep 8, 2024

Thanks for the patience with my reply! 😅

I just marked this project as deprecated, I'm currently not using it and I think these ideas can be achieved in better ways: https://github.com/tiangolo/poetry-version-plugin#-warning-deprecated-

Given that I'll close this one, but thanks for the interest! ☕

@tiangolo tiangolo closed this as completed Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants