From 9ae5c112b4a29076f6f09a2e22e4e82fdec49ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Tue, 4 Feb 2025 01:59:20 +0000 Subject: [PATCH] Extract static metadata from setup.py --- pyproject.toml | 53 +++++++++++++++++++++++++++++++++++++++++++++----- setup-wxsvg.py | 31 ----------------------------- setup.py | 43 +--------------------------------------- 3 files changed, 49 insertions(+), 78 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0843ad0b..2e11223f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,18 +1,61 @@ [project] name = "wxPython" +description = "Cross platform GUI toolkit for Python, \"Phoenix\" version" +requires-python = ">= 3.9" +authors = [ + { name = "Robin Dunn", email = "robin@alldunn.com" }, + { name = "Scott Talbert", email = "swt@techie.net" }, +] +keywords = [ + "GUI", + "awesome", + "cross-platform", + "user-interface", + "wx", + "wxWidgets", + "wxWindows", +] +classifiers = [ + "Development Status :: 6 - Mature", + "Environment :: MacOS X :: Cocoa", + "Environment :: Win32 (MS Windows)", + "Environment :: X11 Applications :: GTK", + "Intended Audience :: Developers", + "License :: OSI Approved", + "Operating System :: MacOS", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: Microsoft :: Windows :: Windows 7", + "Operating System :: Microsoft :: Windows :: Windows 10", + "Operating System :: Microsoft :: Windows :: Windows 11", + "Operating System :: POSIX", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Software Development :: User Interfaces", +] dynamic = [ - "authors", - "classifiers", "dependencies", - "description", - "keywords", "license", "readme", "scripts", - "urls", "version", ] +[project.urls] +Documentation = "https://docs.wxpython.org/" +Download = "https://pypi.org/project/wxPython" +Homepage = "https://wxPython.org/" +Source = "https://github.com/wxWidgets/Phoenix" +Repository = "https://github.com/wxWidgets/Phoenix.git" +Issues = "https://github.com/wxWidgets/Phoenix/issues" +Discuss = "https://discuss.wxpython.org/" + [build-system] requires = [ "setuptools>=70.1", diff --git a/setup-wxsvg.py b/setup-wxsvg.py index e90bcc6d..aeec6998 100644 --- a/setup-wxsvg.py +++ b/setup-wxsvg.py @@ -25,34 +25,9 @@ cfg = Config(noWxConfig=True) DESCRIPTION = 'Wrapper for nanosvg library, plus code for integrating with wxPython' LONG_DESCRIPTION = '' -AUTHOR = 'Robin Dunn' -AUTHOR_EMAIL = 'robin@alldunn.com' -URL = "http://wxPython.org/" -DOWNLOAD_URL = "https://pypi.org/project/wxPython" LICENSE = "wxWindows Library License (https://opensource.org/licenses/wxwindows.php)" PLATFORMS = "WIN32,WIN64,OSX,POSIX" -KEYWORDS = "GUI,wx,wxWindows,wxWidgets,cross-platform,user-interface,awesome" -CLASSIFIERS = """\ -Development Status :: 6 - Mature -Environment :: MacOS X :: Cocoa -Environment :: Win32 (MS Windows) -Environment :: X11 Applications :: GTK -Intended Audience :: Developers -License :: OSI Approved -Operating System :: MacOS :: MacOS X -Operating System :: Microsoft :: Windows :: Windows 7 -Operating System :: Microsoft :: Windows :: Windows 10 -Operating System :: POSIX -Programming Language :: Python :: 3.7 -Programming Language :: Python :: 3.8 -Programming Language :: Python :: 3.9 -Programming Language :: Python :: 3.10 -Programming Language :: Python :: 3.11 -Programming Language :: Python :: 3.12 -Programming Language :: Python :: Implementation :: CPython -Topic :: Software Development :: User Interfaces -""" HERE = os.path.abspath(os.path.dirname(__file__)) PACKAGE = 'wx.svg' @@ -85,13 +60,7 @@ setup(name = 'wx.svg', version = cfg.VERSION, description = DESCRIPTION, long_description = LONG_DESCRIPTION, - author = AUTHOR, - author_email = AUTHOR_EMAIL, - url = URL, - download_url = DOWNLOAD_URL, license = LICENSE, - classifiers = [c for c in CLASSIFIERS.split("\n") if c], - keywords = KEYWORDS, #packages = [PACKAGE], ext_modules = modules, options = { 'build' : BUILD_OPTIONS, }, diff --git a/setup.py b/setup.py index 6f22edc1..e23e1017 100644 --- a/setup.py +++ b/setup.py @@ -31,19 +31,8 @@ DOCS_BASE='http://docs.wxPython.org' #---------------------------------------------------------------------- -NAME = version.PROJECT_NAME -DESCRIPTION = "Cross platform GUI toolkit for Python, \"Phoenix\" version" -AUTHOR = "Robin Dunn" -AUTHOR_EMAIL = "robin@alldunn.com" -URL = "http://wxPython.org/" -PROJECT_URLS = { - "Source": "https://github.com/wxWidgets/Phoenix", - "Documentation": "https://docs.wxpython.org/", - } -DOWNLOAD_URL = "https://pypi.org/project/{}".format(NAME) LICENSE = "wxWindows Library License (https://opensource.org/licenses/wxwindows.php)" PLATFORMS = "WIN32,WIN64,OSX,POSIX" -KEYWORDS = "GUI,wx,wxWindows,wxWidgets,cross-platform,user-interface,awesome" LONG_DESCRIPTION = """\ Welcome to wxPython's Project Phoenix! Phoenix is the improved next-generation @@ -71,27 +60,6 @@ with python). """.format(version=cfg.VERSION, docs_base=DOCS_BASE) -CLASSIFIERS = """\ -Development Status :: 6 - Mature -Environment :: MacOS X :: Cocoa -Environment :: Win32 (MS Windows) -Environment :: X11 Applications :: GTK -Intended Audience :: Developers -License :: OSI Approved -Operating System :: MacOS :: MacOS X -Operating System :: Microsoft :: Windows :: Windows 7 -Operating System :: Microsoft :: Windows :: Windows 10 -Operating System :: POSIX -Programming Language :: Python :: 3.7 -Programming Language :: Python :: 3.8 -Programming Language :: Python :: 3.9 -Programming Language :: Python :: 3.10 -Programming Language :: Python :: 3.11 -Programming Language :: Python :: 3.12 -Programming Language :: Python :: Implementation :: CPython -Topic :: Software Development :: User Interfaces -""" - with open('requirements/install.txt') as fid: INSTALL_REQUIRES = [line.strip() for line in fid.readlines() @@ -358,20 +326,11 @@ BUILD_OPTIONS = { } #'build_base' : cfg.BUILD_BASE } if __name__ == '__main__': - setup(name = NAME, - version = cfg.VERSION, - description = DESCRIPTION, + setup(version = cfg.VERSION, long_description = LONG_DESCRIPTION, long_description_content_type = 'text/x-rst', - author = AUTHOR, - author_email = AUTHOR_EMAIL, - url = URL, - project_urls = PROJECT_URLS, - download_url = DOWNLOAD_URL, license = LICENSE, platforms = PLATFORMS, - classifiers = [c for c in CLASSIFIERS.split("\n") if c], - keywords = KEYWORDS, install_requires = INSTALL_REQUIRES, zip_safe = False, include_package_data = True,