From 99e53d76119b3fb91c225e51cd25b585a6a40343 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Thu, 16 Jan 2025 10:30:54 +0100
Subject: [PATCH] Upgrade pyproject.toml to Poetry v2 format (#215)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Migrate from [tool.poetry] to [project]
https://python-poetry.org/blog/announcing-poetry-2.0.0
https://python-poetry.org/docs/faq/#migrate-pep621-new-static

Use dynamic Poetry classifiers and dependencies,
more convenient but less generic to pyproject.toml project

Use full names
Remove s_b from the authors,
I couldn’t find a commit from him with shortlog
His activity: https://forum.duniter.org/t//528
---
 pyproject.toml | 39 +++++++++++++++++++++++++--------------
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index 308bac9..955bc13 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,31 +1,38 @@
-[tool]
-[tool.poetry]
+[project]
 name = "duniterpy"
 version = "1.2.0"
 description = "Python library for developers of Duniter clients"
-authors = ["inso <insomniak.fr@gmail.com>", "canercandan", "s_b"]
-maintainers = ["vit <vit@free.fr>", "Moul <moul@moul.re>"]
+license = { text = "GPL-3.0-or-later" }
 readme = "README.md"
-license = "GPL-3.0-or-later"
+requires-python = ">=3.9,<4.0"
+authors = [
+    { name = "inso", email = "insomniak.fr@gmail.com"},
+    { name = "canercandan"},
+]
+maintainers = [
+    { name = "vit, Vincent Texier", email = "vit@free.fr"},
+    { name = "Moul, Maël Azimi", email = "moul@moul.re"}
+]
+keywords = ["g1", "duniter", "cryptocurrency", "librecurrency", "library"]
+dynamic = ["classifiers", "dependencies"]
+
+[tool.urls]
 repository = "https://git.duniter.org/clients/python/duniterpy"
 documentation = "https://clients.pages.duniter.org/python/duniterpy/index.html"
-urls = { Changelog = "https://git.duniter.org/clients/python/duniterpy/-/blob/main/CHANGELOG.md" }
-keywords = ["g1", "duniter", "cryptocurrency", "librecurrency", "library"]
-include = ["examples/*.py"]
+"changelog" = "https://git.duniter.org/clients/python/duniterpy/-/blob/main/CHANGELOG.md"
+
+[tool.poetry]
+requires-poetry = ">=2.0"
+include = [{path="examples/*.py", format=["sdist", "wheel"]}]
 classifiers = [
     "Development Status :: 5 - Production/Stable",
     "Natural Language :: English",
     "Operating System :: OS Independent",
-    "Topic :: Software Development :: Libraries",
+    "Topic :: Software Development :: Libraries :: Python Modules",
     "Intended Audience :: Developers",
 ]
 
-[build-system]
-requires = ["poetry-core>=1.0.0"]
-build-backend = "poetry.core.masonry.api"
-
 [tool.poetry.dependencies]
-python = "^3.9.0"
 graphql-core = "^3.2.3"
 websocket-client = "^1.5.2"
 jsonschema = "^4.17.3"
@@ -48,6 +55,10 @@ optional = true
 sphinx = "^6.2.1"
 sphinx_rtd_theme = "^1.2.0"
 
+[build-system]
+requires = ["poetry-core>=2.0.0,<3.0.0"]
+build-backend = "poetry.core.masonry.api"
+
 [tool.isort]
 profile = "black"
 src_paths = ["duniterpy", "tests", "examples"]
-- 
GitLab