jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/995443?usp=email )
Change subject: [dist] use pyproject.toml for distribution setup
..
[dist] use pyproject.toml for distribution setup
- move information fields from setup.py to pyproject.toml
- add tomli to docs requirements and use that package to read the
pyproject.toml within docs.conf.py
- remove fields from __meta__ which are in pyproject.toml
- only support __copyright__', '__url__', '__version__ with pywikibot
and drop support for the others
- read the project name within setup.py using ConfigParser
and add test for this function
Change-Id: Iae9643f3fe49a41e1997790b8c4bec5ef1616b36
---
M docs/conf.py
M docs/requirements.txt
M pyproject.toml
M pywikibot/__init__.py
M pywikibot/__metadata__.py
M setup.py
M tests/setup_tests.py
7 files changed, 197 insertions(+), 164 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/docs/conf.py b/docs/conf.py
index 5ca8569..395e968 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,6 +1,6 @@
"""Configuration file for Sphinx."""
#
-# (C) Pywikibot team, 2014-2023
+# (C) Pywikibot team, 2014-2024
#
# Distributed under the terms of the MIT license.
#
@@ -24,6 +24,7 @@
import os
import re
import sys
+import tomli
import warnings
from pathlib import Path
@@ -78,9 +79,13 @@
root_doc = 'index'
# General information about the project.
-project = pywikibot.__name__.title()
+filepath = Path().absolute().parent / 'pyproject.toml'
+with open(filepath, 'rb') as f:
+meta_data = tomli.load(f)
+
+project = meta_data['project']['name'].title()
project_copyright = pywikibot.__copyright__ # alias since Python 3.5
-author = 'Pywikibot Team'
+author = meta_data['project']['maintainers'][0]['name']
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 0052ead..d55a081 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -6,3 +6,4 @@
sphinxext-opengraph >= 0.9.0
sphinx-notfound-page >= 1.0.0
furo >= 2023.9.10
+tomli
diff --git a/pyproject.toml b/pyproject.toml
index e94bba3..3c8eb7f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,2 +1,127 @@
[build-system]
-requires = ["packaging", "setuptools", "wheel"]
\ No newline at end of file
+requires = ["packaging", "setuptools", "wheel"]
+build-backend = "setuptools.build_meta"
+
+
+[project]
+name = "pywikibot"
+
+##
+# Keep this file readable for all entries above this comment #
+##
+
+authors = [
+{name = "xqt", email = "i...@gno.de"},
+]
+maintainers = [
+{name = "The Pywikibot team", email = "pywiki...@lists.wikimedia.org"},
+]
+description = "Python MediaWiki Bot Framework"
+requires-python = ">=3.7.0"
+keywords = [
+"API", "bot", "client", "framework", "mediawiki", "pwb", "pybot", "python",
+"pywiki", "pywikibase", "pywikibot", "pywikipedia", "pywikipediabot",
+"wiki", "wikibase", "wikidata", "wikimedia", "wikipedia",
+]
+license = {text = "MIT License"}
+classifiers=[
+"Development Status :: 5 - Production/Stable",
+"Environment :: Console",
+"Intended Audience :: Developers",
+"License :: OSI Approved :: MIT License",
+"Natural Language :: Afrikaans",
+"Natural Language :: Arabic",
+"Natural Language :: Basque",
+"Natural Language :: Bengali",
+"Natural Language :: Bosnian",
+"Natural Language :: Bulgarian",
+"Natural Language :: Cantonese",
+"Natural Language :: Catalan",
+"Natural Language :: Chinese (Simplified)",
+"Natural Language :: Chinese (Traditional)",
+"Natural Language :: Croatian",
+"Natural Language :: Czech",
+"Natural Language :: Danish",
+"Natural Language :: Dutch",
+"Natural Language :: English",
+"Natural Language :: Esperanto",
+"Natural Language :: Finnish",
+"Natural Language :: French",
+"Natural Language :: Galician",
+"Natural Language :: German",
+"Natural Language :: Greek",
+"Natural Language :: Hebrew",
+"Natural Language :: Hindi",
+"Natural Language :: Hungarian",
+"Natural Language :: Icelandic",
+"Natural Language :: Indonesian",
+"Natural Language :: Irish",
+"Natural Language :: Italian",
+"Natural Language :: Japanese",
+"Natural Language :: Javanese",
+"Natural Language :: Korean",
+"Natural Language :: Latin",
+"Natural Language :: Latvian",
+"Natural Language :: Lithuanian",
+"Natural Language :: Macedonian",
+"Natural Language :: Malay",
+"Natural Language :: Marathi",
+"Natural Language :: Nepali",
+"Natural Language :: Norwegian",
+"Natural Language ::