Skip to content

Commit

Permalink
Merge pull request #2689 from echoix/pyproject-metadata
Browse files Browse the repository at this point in the history
Extract some static metadata from setup.py to pyproject.toml
  • Loading branch information
swt2c authored Feb 4, 2025
2 parents da22777 + eef0ba4 commit 45f9e89
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 105 deletions.
68 changes: 62 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,74 @@
[project]
name = "wxPython"
description = "Cross platform GUI toolkit for Python, \"Phoenix\" version"
requires-python = ">= 3.9"
authors = [
{ name = "Robin Dunn", email = "[email protected]" },
{ name = "Scott Talbert", email = "[email protected]" },
]
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.scripts]
helpviewer = "wx.tools.helpviewer:main"
img2png = "wx.tools.img2png:main"
img2py = "wx.tools.img2py:main"
img2xpm = "wx.tools.img2xpm:main"
pycrust = "wx.py.PyCrust:main"
pyshell = "wx.py.PyShell:main"
pyslices = "wx.py.PySlices:main"
pyslicesshell = "wx.py.PySlicesShell:main"
pywxrc = "wx.tools.pywxrc:main"
wxdemo = "wx.tools.wxget_docs_demo:demo_main" # Get/Launch Demo
wxdocs = "wx.tools.wxget_docs_demo:docs_main" # Get/Launch Docs
wxget = "wx.tools.wxget:main" # New wx wget

[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",
Expand Down
32 changes: 0 additions & 32 deletions setup-wxsvg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,9 @@

DESCRIPTION = 'Wrapper for nanosvg library, plus code for integrating with wxPython'
LONG_DESCRIPTION = ''
AUTHOR = 'Robin Dunn'
AUTHOR_EMAIL = '[email protected]'
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'
Expand Down Expand Up @@ -85,15 +60,8 @@
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, },
scripts = [],
)
68 changes: 1 addition & 67 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,8 @@

#----------------------------------------------------------------------

NAME = version.PROJECT_NAME
DESCRIPTION = "Cross platform GUI toolkit for Python, \"Phoenix\" version"
AUTHOR = "Robin Dunn"
AUTHOR_EMAIL = "[email protected]"
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
Expand Down Expand Up @@ -71,27 +60,6 @@
""".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()
Expand Down Expand Up @@ -326,28 +294,6 @@ def wx_make_writable(target):

WX_PKGLIST = [cfg.PKGDIR] + [cfg.PKGDIR + '.' + pkg for pkg in find_packages('wx')]

ENTRY_POINTS = {
'console_scripts' : [
"img2png = wx.tools.img2png:main",
"img2py = wx.tools.img2py:main",
"img2xpm = wx.tools.img2xpm:main",
"pywxrc = wx.tools.pywxrc:main",
# ],
# 'gui_scripts' : [ # TODO: Why was this commented out?
"wxget = wx.tools.wxget:main", # New wx wget
"wxdocs = wx.tools.wxget_docs_demo:docs_main", # Get/Launch Docs
"wxdemo = wx.tools.wxget_docs_demo:demo_main", # Get/Launch Demo
"helpviewer = wx.tools.helpviewer:main",
"pycrust = wx.py.PyCrust:main",
"pyshell = wx.py.PyShell:main",
"pyslices = wx.py.PySlices:main",
"pyslicesshell = wx.py.PySlicesShell:main",
],
}

SCRIPTS = []
DATA_FILES = []

HEADERS = None
BUILD_OPTIONS = { } #'build_base' : cfg.BUILD_BASE }
#if cfg.WXPORT == 'msw':
Expand All @@ -358,20 +304,11 @@ def wx_make_writable(target):


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,
Expand All @@ -381,9 +318,6 @@ def wx_make_writable(target):

options = { 'build' : BUILD_OPTIONS },

scripts = SCRIPTS,
data_files = DATA_FILES,
headers = HEADERS,
cmdclass = CMDCLASS,
entry_points = ENTRY_POINTS,
)

0 comments on commit 45f9e89

Please sign in to comment.