Context
So, I'm trying to create a new Python package following this tutorial: https://packaging.python.org/en/latest/tutorials/packaging-projects/
As the tutorial says, in my pyproject.toml
I should have this structure:
[project]
name = "example_package_YOUR_USERNAME_HERE"
version = "0.0.1"
authors = [
{ name="Example Author", email="author@example.com" },
]
description = "A small example package"
but when I created this file with poetry init
, it created this structure:
[tool.poetry]
name = "example_package_YOUR_USERNAME_HERE"
version = "0.0.1"
authors = [
{ name="Example Author", email="author@example.com" },
]
description = "A small example package"
The main difference between these two is the [project]
instead of [tool.poetry]
section header.
I also see, that poetry
can't do anything with the project, when there is no [tool.poetry]
section in pyproject.toml
So my questions are:
What are the differences between these two?
Should I have only one or both at the same time in my
pyproject.toml
? And in case I should keep both, what should it contain?In case there should be only
[tool.poetry]
, do I need to follow the same rules for the content and sub-sections as for[project]
? So for example[project.urls]
would be renamed to[tool.poetry.urls]
?What is the best future-proof choice for publishing on PyPI? Or are there no difference?
Is changing the
[build-system]
frompoetry-core
tosetuptools
a good idea? Or I should keeppoetry-core
?