mtkennerly / poetry-dynamic-versioning

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

Question about substitution with `pip install -e .` #146

Closed jsolbrig closed 9 months ago

jsolbrig commented 9 months ago

I'm trying to use poetry-dynamic-versioning with a project that I routinely install via pip install -e .. I do not use the Poetry CLI. I'm using substitution in package/_version.py. It is important for a few reasons that, even when installed using -e, the version is correctly reflected in that version file.

Is there a way to get poetry-dynamic-versioning to leave the substitutions in place rather than reverting them when the plugin is disabled?

mtkennerly commented 9 months ago

You're right that this hadn't been supported. Although you could run the poetry-dynamic-versioning CLI on its own to leave the changes in place, that would leave the changes in all files (including pyproject.toml), and if you're not using the Poetry CLI anyway, then you probably wouldn't want to add an extra command just for this.

v1.1.0 now includes this functionality, and I gave an example of how to use it in #147 (persistent-substitution = true).