Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,11 @@ jobs:
if ! python3 scripts/build_api.py _site; then
echo "::warning::couldn't build the Data API page"
fi
# The "Failed building wheel?" hub, from this scan's data/coverage.json (no network). Unguarded, like the
# campaign pages: every package page with a "Why the install fails" section links back to it, so if it
# can't be built the deploy stops rather than publish those links dead. Before the Install-time builds page,
# which links it only if it was built.
python3 scripts/build_failed_building_wheel.py data/coverage.json _site
python3 scripts/build_campaigns.py data/coverage.json data/history.json data/changes.json campaigns.toml _site
# Extra home-page card and platform-page section: if it fails, the card says the list isn't available and
# the platform pages leave the section out (they warn about the missing file) rather than stopping the deploy.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ curl -sfL --max-time 60 -o _site/data/gap-wheels.json https://wheelgap.github.io
curl -sfL --max-time 60 -o _site/data/status.json https://wheelgap.github.io/wheels/data/status.json \
|| echo "::warning::couldn't download status.json from wheelgap.github.io/wheels"
python3 scripts/build_pages.py data/coverage.json _site notes _site/data/gap-wheels.json _site/data/status.json
python3 scripts/build_failed_building_wheel.py data/coverage.json _site
python3 scripts/build_campaigns.py data/coverage.json data/history.json data/changes.json campaigns.toml _site
python3 scripts/build_blockers.py data/coverage.json _site/data/blockers.json
python3 scripts/build_free_threaded.py data/upstream-fixes-freethreaded.json data/builds.json data/coverage.json _site --proofs data/upstream-proofs.json
Expand Down
407 changes: 407 additions & 0 deletions scripts/build_failed_building_wheel.py

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions scripts/build_install_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
python3 scripts/build_install_builds.py data/coverage.json _site

Writes <site>/platforms/install-builds/index.html and adds it to <site>/sitemap.xml, so run it after build_pages.py, which
writes the sitemap, and after build_lockdown_page.py, whose page it links once it's built. Plain HTML, no JavaScript, under the site's usual CSP; every value from the file is escaped. A
writes the sitemap, and after build_lockdown_page.py and build_failed_building_wheel.py, whose pages it links once
they're built. Plain HTML, no JavaScript, under the site's usual CSP; every value from the file is escaped. A
file of another shape stops with an error, so the publish step can warn and leave the page out.
"""

Expand Down Expand Up @@ -141,8 +142,9 @@ def _floors(data: dict) -> str:
return f"glibc {t.get('glibc')}, musl {t.get('musl')}, macOS {t.get('macos')}"


def page(data: dict, page_names: set[str], lockdown: bool = False) -> str:
"""lockdown: whether the Lockdown page (build_lockdown_page.py) is in the site, so the page links it."""
def page(data: dict, page_names: set[str], lockdown: bool = False, hub: bool = False) -> str:
"""lockdown: whether the Lockdown page (build_lockdown_page.py) is in the site, so the page links it. hub: the same
for the "Failed building wheel?" hub (build_failed_building_wheel.py)."""
e = html.escape
built = counts(data)
total = len(data["packages"])
Expand Down Expand Up @@ -190,6 +192,12 @@ def page(data: dict, page_names: set[str], lockdown: bool = False) -> str:
+ f"<p>The {min(len(main), LIMITS):,} most downloaded of the {len(main):,} packages that build from source "
"there, and on how many of the targets above each does.</p>"
+ build_platform_pages.rows_fold(_list(main, page_names, data), min(len(main), LIMITS))
+ (
f'<p>Every top package that builds from source, on each platform, with the release that has a wheel where there is one: '
f'<a href="{ROOT}failed-building-wheel/">Failed building wheel?</a></p>'
if hub
else ""
)
+ "</section>"
+ '<section aria-labelledby="method"><h2 id="method">What this counts</h2>'
"<p>Each package's latest release on PyPI, checked the way pip and uv pick files, for each Python and "
Expand Down Expand Up @@ -220,7 +228,8 @@ def build(coverage_path: Path, site: Path) -> Path:
path = out / "index.html"
# The Lockdown page is built first (scan.yml); linked only once it's there, so a failed build leaves no dead link.
lockdown = (site / "lockdown" / "index.html").is_file()
path.write_text(page(data, page_names, lockdown), encoding="utf-8")
hub = (site / "failed-building-wheel" / "index.html").is_file()
path.write_text(page(data, page_names, lockdown, hub), encoding="utf-8")
build_campaigns.add_to_sitemap(site, [URL])
return path

Expand Down
27 changes: 24 additions & 3 deletions scripts/build_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,32 @@ def gap_platforms(package: dict, targets: list[dict], statuses: tuple[str, ...]
return [pl for pl in PLATFORM_NAMES if pl in found]


# The "Failed building wheel?" hub (build_failed_building_wheel.py), from a package page. The publish step builds it
# from the same coverage.json, right after these pages, and stops if it can't, so the link is never dead.
HUB = "../../failed-building-wheel/"


def hub_line(platforms: list[str], *, builds: bool) -> str:
"""The answer's link back to the hub's list for each platform in `platforms` where the package has the page's error
(the hub's anchors: the platform for building from source, missing-<platform> for no distribution)."""
if not platforms:
return ""
e = html.escape
anchor = "" if builds else "missing-"
links = join_names([f'<a href="{HUB}#{anchor}{e(pl)}">{e(PLATFORM_NAMES[pl])}</a>' for pl in platforms])
what = "build from source" if builds else "have no matching distribution"
return f" <p>All the top packages that {what} on {links}.</p>\n"


def answer_html(
name: str, version: str, python: str, example: str, platforms: list[str], *, builds: bool
name: str, version: str, python: str, example: str, platforms: list[str], *, builds: bool,
hub: list[str] | None = None,
) -> tuple[str, str]:
"""The short answer for someone who arrived with the install's error ("Failed building wheel for NAME", or pip's
"No matching distribution found" where there's no sdist to build): why it happens, where it does for this package
(`platforms`, on a regular Python), the ways out, and a command for `python` on `example`, a platform where that
Python has the error."""
Python has the error. hub: the platforms whose list on the "Failed building wheel?" hub the answer links (those
where a regular Python has the page's error)."""
e = html.escape
where = ", ".join(PLATFORM_NAMES[pl] for pl in platforms)
if builds:
Expand Down Expand Up @@ -351,6 +370,7 @@ def answer_html(
f" <p>{ways}</p>\n"
f" <p>{e(tool_intro)}</p>\n"
f" <pre><code>{e(command)}</code></pre>\n"
f"{hub_line(hub or [], builds=builds)}"
" </section>\n"
)
error = "Failed building wheel for" if builds else "No matching distribution found for"
Expand Down Expand Up @@ -754,7 +774,8 @@ def page(
example_python = preferred if preferred in pythons else max(pythons, key=install_results.python_key)
example_platform = next(pl for pl in PLATFORM_NAMES if (example_python, pl) in kind)
where = [pl for pl in PLATFORM_NAMES if any(p == pl for _, p, _ in cells)]
answer, faq = answer_html(name, version, example_python, example_platform, where, builds=builds)
hub = [pl for pl in PLATFORM_NAMES if any(p == pl for _, p in kind)]
answer, faq = answer_html(name, version, example_python, example_platform, where, builds=builds, hub=hub)
campaign_links = []
for status, campaign in campaigns or []:
link = f'<a href="../../campaigns/{e(campaign["id"])}/">{e(campaign["title"])}</a>'
Expand Down
13 changes: 12 additions & 1 deletion scripts/build_platform_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Runs after the package and campaign pages so all platform URLs can be added to the same sitemap.
With --history, each platform page also says how its share has moved over time (#169).
With --blockers (build_blockers.py's output), each also lists the packages blocking the most installs (#183).
Each native platform's page links its section of the "Failed building wheel?" hub once build_failed_building_wheel.py
has built it.
"""

from __future__ import annotations
Expand Down Expand Up @@ -433,8 +435,17 @@ def build(
extras += '<p><a href="../../#lab-section">See build lab results</a> for this platform.</p>'

title = f"Python {python} packages without {friendly} wheels"
# The "Failed building wheel?" hub's section for this platform (build_failed_building_wheel.py, which the
# publish step runs first), once it's built. Pyodide has none: nobody's pip builds there.
hub = (
f"<p>Failed building wheel on {e(friendly)}? "
f'<a href="../../failed-building-wheel/#{e(platform)}">Every top package that builds from source here, '
"and the fix</a></p>"
if platform != "pyodide" and (site / "failed-building-wheel" / "index.html").is_file()
else ""
)
content = (
f"<section><h2>Most-wanted wheels for Python {e(python)}</h2>{table}{extras}"
f"{hub}<section><h2>Most-wanted wheels for Python {e(python)}</h2>{table}{extras}"
'<p><a href="../../">Search every package</a></p></section>'
)
# Whole-tree installs are only checked for some Pythons: the newest one with an entry for this platform.
Expand Down
2 changes: 1 addition & 1 deletion site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ <h2 id="lab-title">Build lab: no wheel, but does it build?</h2>
<footer class="wg-footer">
<div class="wg-footer-inner">
<p>Each night, wheelgap checks the latest release of top packages from <a href="https://hugovk.dev/top-pypi-packages/">top-pypi-packages</a> against every platform. <span id="pyodide-note">Pyodide counts only wheels on PyPI; it also ships its own builds of many popular packages.</span></p>
<p>Data: <a href="data/coverage.json">Raw data (CC0)</a> · <a href="data/coverage.csv">CSV</a> · <a href="https://github.com/wheelgap/tracker#api-for-scripts-and-agents">Per-package JSON</a> · <a href="api/">Data API</a> · More: <a href="platforms/history/">Platform history</a> · <a href="lockdown/">Refusing install-time builds</a> · <a href="campaigns/">Campaigns</a> · <a href="new/">New wheels</a> · <a href="drops/">Dropped platforms</a> · <a href="upstream/">Upstream wheels</a> · <a href="https://github.com/wheelgap/wheelgap/discussions/43">Roadmap</a> · <a href="https://github.com/wheelgap/wheelgap/issues/new?template=bug_report.yml">Report a wrong result</a></p>
<p>Data: <a href="data/coverage.json">Raw data (CC0)</a> · <a href="data/coverage.csv">CSV</a> · <a href="https://github.com/wheelgap/tracker#api-for-scripts-and-agents">Per-package JSON</a> · <a href="api/">Data API</a> · More: <a href="failed-building-wheel/">Failed building wheel?</a> · <a href="platforms/history/">Platform history</a> · <a href="lockdown/">Refusing install-time builds</a> · <a href="campaigns/">Campaigns</a> · <a href="new/">New wheels</a> · <a href="drops/">Dropped platforms</a> · <a href="upstream/">Upstream wheels</a> · <a href="https://github.com/wheelgap/wheelgap/discussions/43">Roadmap</a> · <a href="https://github.com/wheelgap/wheelgap/issues/new?template=bug_report.yml">Report a wrong result</a></p>
<p>Design by <a href="https://github.com/kunalkshah1">Kunal Shah (@kunalkshah1)</a>, the winner of the tracker's <a href="https://github.com/wheelgap/wheelgap/discussions/154">redesign challenge</a>.</p>
<nav class="wg-footer-nav" aria-label="wheelgap sites">
<a class="wg-brand" href="/"><svg class="wg-mark" viewBox="0 0 64 64" width="20" height="20" aria-hidden="true" focusable="false"><path class="wg-mark-wheel" fill="#1f4e79" d="M56.72,18.85 A28,28 0 1 1 45.15,7.28 L39.98,16.99 A17,17 0 1 0 47.01,24.02 Z"/><path class="wg-mark-gap" fill="#f2a900" d="M50.86,6.99 A28,28 0 0 1 58.41,14.54 L49.29,20.69 A17,17 0 0 0 44.71,16.11 Z"/><circle class="wg-mark-wheel" fill="#1f4e79" cx="32" cy="32" r="6"/></svg><span>wheelgap</span></a>
Expand Down
Loading