Skip to content

Commit

Permalink
Only warn for suspicious package names for now
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Oct 31, 2024
1 parent a282e50 commit 53e5357
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/requirements.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import sys
from pathlib import Path

lock_path = Path("pyodide") / "dist" / "pyodide-lock.json"
Expand All @@ -18,10 +19,12 @@
"matplotlib-pyodide", # pyodide implementation detail
"micropip", # pyodide implementation detail
"pyodide-http", # pyodide implementation detail
"widgetsnbextension", # JupyterLite mock with fake version
]

PACKAGE_PYPI_NAME_FIXES = {
"fiona": "fiona", # no-op, otherwise a false positive
"Jinja2": "Jinja2", # no-op, otherwise a false positive
"markdown": "Markdown",
"netcdf4": "netCDF4",
"Pillow": "pillow",
Expand All @@ -47,8 +50,9 @@
name_guess = package["file_name"].split("-")[0]
if name_guess != package["name"].replace("-", "_"):
if package["name"] not in PACKAGE_PYPI_NAME_FIXES:
raise Exception(
f"Suspicious package name {package['name']} with filename {name_guess}"
print(
f"Suspicious package name {package['name']} with filename {name_guess}",
sys.stderr,
)

packages[name] = package["version"]
Expand Down

0 comments on commit 53e5357

Please sign in to comment.