From f22739db986087f7bd1746cb34f56bcd09c4f27c Mon Sep 17 00:00:00 2001 From: Juniper Tyree <50025784+juntyr@users.noreply.github.com> Date: Tue, 28 Jan 2025 06:54:29 +0000 Subject: [PATCH] Exclude pure PyPi packages from the PyPa simple index --- tools/pypa-simple.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/pypa-simple.py b/tools/pypa-simple.py index f1c35c0a4..f950c8c5a 100644 --- a/tools/pypa-simple.py +++ b/tools/pypa-simple.py @@ -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() @@ -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"])