poetry-dynamic-versioning icon indicating copy to clipboard operation
poetry-dynamic-versioning copied to clipboard

Possible install documentation update required

Open maxinelasp opened this issue 1 year ago • 1 comments

Hi, we're using poetry-dynamic-versioning in our Github repo and finding that it works quite well.

However, we recently encountered an issue where someone new was trying to install the plugin using poetry self add "poetry-dynamic-versioning[plugin]", as recommended in the README, but he got the error Could not find a matching version of package “poetry-dynamic-versioning[plugin]”. I looked through the Poetry docs, suggested running poetry self add poetry-dynamic-versioning and that worked fine.

So, I wanted to suggest updating the readme in this repo to follow that Poetry standard instead. I'm happy to open a PR for that change, but I wanted to see if I was missing something with the difference between the two install commands.

Thanks for the plugin, it's a good fix for a missing piece in Poetry.

maxinelasp avatar Oct 17 '24 14:10 maxinelasp

Hi! Could you tell me which version of Poetry they're using and how they installed it (pip, pipx, etc)? And although the install worked, is the plugin actually activating when they run poetry build or other commands?

The [plugin] format specifies an "extra". It's covered in the Poetry docs here: https://python-poetry.org/docs/cli/#add

image

I'm using Poetry 1.8.3 installed by pipx on Windows, and it works on my end:

$ poetry self add "poetry-dynamic-versioning[plugin]"
Using version ^1.4.1 for poetry-dynamic-versioning

Updating dependencies
Resolving dependencies... (0.4s)

Package operations: 4 installs, 0 updates, 0 removals

  - Installing markupsafe (3.0.2)
  - Installing dunamai (1.22.0)
  - Installing jinja2 (3.1.4)
  - Installing poetry-dynamic-versioning (1.4.1)

Writing lock file

mtkennerly avatar Oct 18 '24 17:10 mtkennerly

Hi, I believe it was Poetry v1.7.1 installed with Pip. I have also successfully installed the plugin using that syntax before. The plugin is definitely working, as we depend on it in the code and he has been running the code successfully.

maxinelasp avatar Oct 28 '24 17:10 maxinelasp

Hmm, that's strange then. I'm hesitant to change the instructions since I can't reproduce the issue. I'll leave this open for a while in case anyone else runs into this and can help confirm.

mtkennerly avatar Nov 07 '24 18:11 mtkennerly

With Poetry 2.0.0, you can simplify this by using tool.poetry.requires-plugins:

[tool.poetry.requires-plugins]
poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }

mtkennerly avatar Jan 07 '25 21:01 mtkennerly