Skip to content

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

@sandrinesuire

Description

@sandrinesuire

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 = "[email protected]"}
]
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions