mtkennerly / poetry-dynamic-versioning

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

A duplication of the name field is required in pyproject.toml when using poetry-dynamic-versioning with poetry_pep621 #180

Closed Simon-McIntosh closed 3 months ago

Simon-McIntosh commented 4 months ago

Use of poetry-dynamic-versioning with poetry_pep621 poetry-core@git+https://github.com/radoering/poetry-core.git@pep621-support requires a duplication of the project's name in pyproject.toml.

Pep621 and poetry-core require that the name field is defined as project.name whilst poetry-dynamic-versioning appears to source the project name from tool.poetry.name.

Running poetry_pep621 on a project with a duplicated name field in pyproject.toml returns an error code of 1 due to this duplicated field.

Could poetry-dynamic-versioning extract name from project.name rather than tool.poetry.name when using a pep621 compliant poetry-core build-backend?

mtkennerly commented 4 months ago

Hey, thanks for reporting this. I'll test it out and add handling for the project section :)

Simon-McIntosh commented 3 months ago

Hi, thanks for looking into this. I have raised the minimum version for poetry-dynamic-versioning to v1.4.0 and removed the name field from the tool.poetry section as shown below. We I then run poetry_pep621 install the process fails with 'name' printed back to the terminal as before. Am I missing something?

[build-system] requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.4.0,<2.0.0"] build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry] version = "0.0.0"

mtkennerly commented 3 months ago

Poetry ignores the build-system section for the main project (https://github.com/python-poetry/poetry/issues/6154#issuecomment-1218493969), so you do still need to install via poetry self add "poetry-dynamic-versioning[plugin]". What plugin version do you see in poetry self show?