How to specify dependencies: PEP 508 strings or a table in TOML?

Yes, the reason why I started Poetry was to build a single tool to manage Python projects. However, some of its features are only possible thanks to its own metadata format, that are not restricted by the limitation of the existing specifications and tools. One example that comes to mind is the ability to specify a source of installation for a specific package via the source keyword:

[tool.poetry.dependencies]
requests = {"version" = "^2.24.0", source = "my-custom-index"}

[[tool.poetry.source]]
name = "my-custom-index"
url = "https://example.com/simple/"
secondary = true

So even with PEP 633 there would be a lot of work and the need to remove or completely redesign features for Poetry to support it. However PEP 633 would ease this transition because Poetry already is able to programmatically manipulate pyproject.toml file which is harder with PEP 631 because dependencies are just one big string without concepts separation.

2 Likes