Skip to content

Commit

Permalink
Exclude pure PyPi packages from the PyPa simple index
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Jan 28, 2025
1 parent f77b483 commit f22739d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/pypa-simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import json
import re
import shutil
import yaml
from pathlib import Path

lock_path = Path("pyodide") / "dist" / "pyodide-lock.json"
recipe_path = Path("pyodide") / "packages"
pypa_path = Path("pypa") / "simple"

parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -41,6 +43,19 @@
if package["install_dir"] != "site":
continue

with open(recipe_path / package["name"] / "meta.yaml") as f:
recipe = yaml.load(f, yaml.SafeLoader)

url = recipe["source"]["url"]

if (
url.startswith("https://files.pythonhosted.org/packages") and
url.endswith("none-any.whl") and
package["name"] != "micropip"
):
print(f"excluding pure PyPi package {package['name']} from repository")
continue

name = PACKAGE_PYPI_NAME_FIXES.get(package["name"], package["name"])
packages[name] = dict(filename=package["file_name"], sha256=package["sha256"])

Expand Down

0 comments on commit f22739d

Please sign in to comment.