mtkennerly / poetry-dynamic-versioning

Plugin for Poetry to enable dynamic versioning based on VCS tags
MIT License
588 stars 36 forks source link

Issue with File Substitution during poetry build with poetry-dynamic-versioning #148

Closed niniack closed 9 months ago

niniack commented 9 months ago

Description:

I am encountering an unexpected behavior when using poetry build in conjunction with the poetry-dynamic-versioning plugin. While the build process correctly outputs the project with the version based on my git tag, it does not update the version in the specified files (pyproject.toml, *_version.py), leaving them at the placeholder "0.0.0".

Steps to Reproduce:

  1. Install poetry using the following command:
    curl -sSL https://install.python-poetry.org | python3 -
  2. Install dynamic versioning using the following command:
    ${XDG_DATA_HOME:-~/.local/share}/pypoetry/venv/bin/pip install poetry-dynamic-versioning
  3. Run poetry build.

Expected Behavior:

The specified files should have their version placeholders substituted with the correct version from the git tag.

Actual Behavior:

The version in the specified files remains at the placeholder "0.0.0".

Additional Information:

Question:

Is it expected for the plugin not to perform substitution when running poetry build?

Environment:

mtkennerly commented 9 months ago

Is it expected for the plugin not to perform substitution when running poetry build?

The plugin will modify them, but only temporarily, so that the modified versions are included in the sdist and wheel artifacts. After the build artifacts are produced, the plugin reverts the files in the repository.

If you'd like to leave the changes in place, then you can run the poetry dynamic-versioning command.

niniack commented 9 months ago

Thanks for the quick response! Good to know