Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Simon-McIntosh opened this issue May 17, 2024 · 3 comments
Milestone

Comments

@Simon-McIntosh
Copy link

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
Copy link
Owner

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

mtkennerly added a commit that referenced this issue Jun 17, 2024
@mtkennerly mtkennerly added this to the v1.4.0 milestone Jun 17, 2024
@Simon-McIntosh
Copy link
Author

Simon-McIntosh commented Jun 18, 2024

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
Copy link
Owner

Poetry ignores the build-system section for the main project (python-poetry/poetry#6154 (comment)), 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants