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

poetry 2.0, adding source section fails if there is no pre-existing [tool.poetry] section in the pyproject.toml #9913

Closed
sandrinesuire opened this issue Dec 19, 2024 · 4 comments · Fixed by #9917
Labels
kind/bug Something isn't working as expected

Comments

@sandrinesuire
Copy link

Description

with poetry 2.0.0 in main branche

poetry list

return

...
source add         Add source configuration for project.
source remove      Remove source configured for the project.
source show        Show information about sources configured for the project.

C:\git\....>poetry source add foo https://my_private_repos/api/pypi/common-pypi/simple/

return this error

[tool.poetry] section not found in C:/git/..../pyproject.toml

Workarounds

nothing

Poetry Installation Method

pipx

Operating System

windows 10

Poetry Version

branch main 2.0.0

Poetry Configuration

nothing

Python Sysconfig

nothing

Example pyproject.toml

[project]
name = "crude..."
version = "0.1.0"
description = ""
authors = [
    {name = "...",email = "sandrine....@....com"}
]
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
    "websockets (<=12.0)"
]


[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

Poetry Runtime Logs

nothing
@sandrinesuire sandrinesuire added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 19, 2024
@Secrus
Copy link
Member

Secrus commented Dec 19, 2024

I can not reproduce. On my machine, poetry installed from the main branch adds source correctly to the [project]-based scheme.

@Secrus Secrus added status/needs-reproduction Issue needs a minimal reproduction to be confirmed and removed status/triage This issue needs to be triaged labels Dec 19, 2024
@sandrinesuire
Copy link
Author

sandrinesuire commented Dec 19, 2024

poetry2_0_0_dev0

you can see the screen shot of a test project, maybe I made an error if you can't reproduce it.

@Secrus
Copy link
Member

Secrus commented Dec 19, 2024

OK, got a reproducer and understand what the issue is.

@Secrus Secrus changed the title poetry 2.0.0 poetry 2.0, adding source section fails if there is no pre-existing [tool.poetry] section in the pyproject.toml Dec 19, 2024
@Secrus Secrus removed the status/needs-reproduction Issue needs a minimal reproduction to be confirmed label Dec 20, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@Secrus @sandrinesuire and others