Skip to content

Commit 5b3e9a5

Browse files
committed
Ensure not found packages have helpful links, update "help" to ensure lowercase package names.
1 parent 822bd97 commit 5b3e9a5

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

help/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ <h2 id="api">Our API</h2>
8989
GET api/package/&lt;package_name&gt;.json
9090
</code></pre>
9191

92+
<p><strong>(🚨 Note: You must use <u>lowercase package names</u> in the URL!)</strong></p>
93+
9294
<p>This will return a JSON object containing the following metadata (or respond with a 404 status code if the package's status is unknown):</p>
9395

9496
<ul>

package/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ async def main():
108108
return
109109
pypi_metadata = await fetch_pypi_metadata(package_name)
110110
if not pypi_metadata:
111-
target.innerHTML = f"<h2>🤷 Package '{package_name}' not found on PyPI.</h2>"
111+
target.innerHTML = f"""<h2>🤷 Package '{package_name}' not found on PyPI.</h2>
112+
<p>Please check the package name and try again.</p>
113+
114+
<p>(Here are the <a href="https://pyodide.org/en/stable/usage/packages-in-pyodide.html" target="_blank">packages currently available in Pyodide</a> 📦 or, alternatively, you can try searching for the package on <a href="https://pypi.org/search/?q={package_name}" target="_blank">PyPI</a> 🔍.)</p>
115+
116+
"""
112117
return
113118
# Remove the loading text.
114119
loading_text.remove()

0 commit comments

Comments
 (0)