Skip to content

Commit 42a42bf

Browse files
committed
build: add long project description to wheel metadata
The wheel was missing the long description (the review thread's other fields were already restored). Add it via pyproject [project].readme (inline text), emitted by build_distrib.py — reusing the concise blurb the old setuptools build shipped, not the full README.
1 parent f797c0b commit 42a42bf

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dynamic = ["version"]
1111
requires-python = ">=3.10"
1212
license = { text = "BSD-3-Clause" }
1313
description = "Python bindings for the Chromium Embedded Framework"
14+
readme = { text = "CEF Python is an open source project founded by Czarek Tomczak in 2012 to provide python bindings for the Chromium Embedded Framework. Examples of embedding CEF browser are available for many popular GUI toolkits including: wxPython, PyQt, PySide, Kivy, Panda3D, PyGTK, PyGObject, PyGame/PyOpenGL and PyWin32.\n\nThere are many use cases for CEF. You can embed a web browser control based on Chromium with great HTML 5 support. You can use it to create a HTML 5 based GUI in an application, this can act as a replacement for standard GUI toolkits like wxWidgets, Qt or GTK. You can render web content off-screen in application that use custom drawing frameworks. You can use it for automated testing of existing applications. You can use it for web scraping or as a web crawler, or other kind of internet bots.\n\nProject website:\nhttps://github.com/cztomczak/cefpython", content-type = "text/plain" }
1415
authors = [
1516
{ name = "Czarek Tomczak", email = "czarek.tomczak@gmail.com" },
1617
]

tools/build_distrib.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,29 @@ def _core_metadata(version, project):
196196
for classifier in project.get("classifiers", []):
197197
lines.append("Classifier: " + classifier)
198198

199-
return ("\n".join(lines) + "\n").encode("utf-8")
199+
# Long description (Description body). PEP 621 readme: a table with an
200+
# inline "text" (+ "content-type") or a "file", or a bare filename string.
201+
body = ""
202+
readme = project.get("readme")
203+
if isinstance(readme, dict):
204+
content_type = readme.get("content-type", "text/plain")
205+
if readme.get("text"):
206+
body = readme["text"]
207+
elif readme.get("file"):
208+
with open(readme["file"], encoding="utf-8") as f:
209+
body = f.read()
210+
if body:
211+
lines.append("Description-Content-Type: " + content_type)
212+
elif isinstance(readme, str):
213+
with open(readme, encoding="utf-8") as f:
214+
body = f.read()
215+
lines.append("Description-Content-Type: text/markdown")
216+
217+
header = "\n".join(lines) + "\n"
218+
# The description body follows the headers, separated by one blank line.
219+
if body:
220+
return (header + "\n" + body + "\n").encode("utf-8")
221+
return header.encode("utf-8")
200222

201223

202224
def _reduce_package_size_issue262(pkg_dir):

0 commit comments

Comments
 (0)