poetry-version-plugin icon indicating copy to clipboard operation
poetry-version-plugin copied to clipboard

poetry commands fail when commit is not tagged

Open BayerSe opened this issue 2 years ago • 1 comments

Hi @tiangolo, many thanks for adding this plugin! I'm currently working on replacing pipenv with poetry and this seems to be the last missing piece.

When testing your plugin I realized that many poetry commands fail when there is either no git tag set at all or when the current commit is not tagged. Do I misunderstand some step in the intended workflow or is this a bug?

Below please find the steps required to reproduce the errors. Also other commands, e.g. poetry install fail with the same message.

# Preparation steps
poetry new TestPackage
git init TestPackage
cd TestPackage

# works
poetry shell
exit

# add plugin
echo \n[tool.poetry-version-plugin]\nsource = \"git-tag\" >> pyproject.toml

# raises: 
# fatal: No names found, cannot describe anything.
# poetry-version-plugin: No Git tag found, not extracting dynamic version
poetry shell

# create a tag
git add -A
git commit -a -m "Initial commit"
git tag 0.0.1

# works
poetry shell
exit

# add a new commit without tag
echo TestPackage > README.md
git add README.md
git commit -a -m "add readme"

# raises:
# fatal: no tag exactly matches '6972216108011dd40616c7e92fbd75ee00f96498'
# poetry-version-plugin: No Git tag found, not extracting dynamic version
poetry shell

BayerSe avatar Aug 09 '21 08:08 BayerSe

I met the same issue. Are there any plans to solve it?

ar90n avatar Apr 10 '22 22:04 ar90n