mtkennerly / poetry-dynamic-versioning

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

`poetry install` with editable deps using dynamic versions always reports a downgrade. #165

Closed alexjball closed 7 months ago

alexjball commented 7 months ago

When installing a project that has an editable install on a project using dynamic versions, poetry always reports that it's downgrading from the last-installed dynamic version to the version in the pyproject (0.0.0). I would expect poetry to think its installing the latest dynamic version, so that poetry install eventually reports that there is nothing to do.

This does cause poetry to re-prepare the package being installed, which doesn't take very long since everything is already present in the venv, but takes longer than a no-op install.

repro: https://github.com/alexjball/poetry-dynamic-versioning/commit/8e4f720214360f7d437f08854b32f3f8c3070bcd

❯ git tag lib-a@1.0.0

❯ poetry install
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing lib-a (0.0.0 /home/aball/dev/poetry-dynamic-versioning/dyn-demo/lib-a)

Installing the current project: dyn-demo (0.1.0)

❯ poetry install
Installing dependencies from lock file

Package operations: 0 installs, 1 update, 0 removals

  • Downgrading lib-a (1.0.0 /home/aball/dev/poetry-dynamic-versioning/dyn-demo/lib-a -> 0.0.0 /home/aball/dev/poetry-dynamic-versioning/dyn-demo/lib-a)

Installing the current project: dyn-demo (0.1.0)
mtkennerly commented 7 months ago

Hi! This is the same issue from https://github.com/mtkennerly/poetry-dynamic-versioning/issues/158 . Poetry's internal logic doesn't expect a pyproject.toml's version field to change partway through processing, so I don't think we can do much about this, unfortunately.