From 9ca5bdfd82409c1b4764840fec46f42ab4350f42 Mon Sep 17 00:00:00 2001 From: lanyue-llk <270302213+lanyue-llk@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:29:00 +0800 Subject: [PATCH] test(packaging): verify source and wheel installs with pip --- CONTRIBUTING.md | 2 +- Makefile | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9a1951b4d..f14b8ac72 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,7 +97,7 @@ For report releases, open success and failure details, evidence dialogs and retu
What the package gate tests -The gate builds a source archive, then a wheel from that archive. It compares installed modules and resources byte for byte and exercises TypeScript tool bridges, synthetic TEDS revisions, LangChain extraction and Crawl4AI downloads against local HTTP fixtures, including HTTP failures. Missing, stale or extra installed files fail the gate. Node tests use `node:module.stripTypeScriptTypes`. +The gate builds a source archive, then a wheel from that archive. Standard `python -m pip` installs both formats in a clean virtual environment outside the checkout, checks dependencies with `pip check`, and runs the installed command before the wheel smoke tests. It compares installed modules and resources byte for byte and exercises TypeScript tool bridges, synthetic TEDS revisions, LangChain extraction and Crawl4AI downloads against local HTTP fixtures, including HTTP failures. Missing, stale or extra installed files fail the gate. Node tests use `node:module.stripTypeScriptTypes`.
diff --git a/Makefile b/Makefile index f2456e2ce..98374f168 100644 --- a/Makefile +++ b/Makefile @@ -71,8 +71,15 @@ package-check: runtime-check test "$$#" -eq 1; test -f "$$1"; \ wheel="$$1"; \ cd "$$package_run"; \ - $(UV) run --no-project --isolated --python 3.11 --with "$$wheel" \ - python "$$project_root/tests/package_smoke.py" --source-root "$$project_root" \ + $(UV) venv --seed --python 3.11 "$$package_run/pip-venv"; \ + pip_python="$$package_run/pip-venv/bin/python"; \ + set -- "$$package_build"/*.tar.gz; test "$$#" -eq 1; \ + "$$pip_python" -m pip install "$$1"; \ + "$$pip_python" -m pip check; \ + "$$package_run/pip-venv/bin/browser-harness-eval" validate; \ + "$$pip_python" -m pip install --force-reinstall --no-deps "$$wheel"; \ + "$$pip_python" -m pip check; \ + "$$pip_python" "$$project_root/tests/package_smoke.py" --source-root "$$project_root" \ --node-html-markdown-path "$$project_root/node_modules/node-html-markdown"; \ $(UV) run --no-project --isolated --python 3.11 --with "$${wheel}[webmainbench-eval]" \ python "$$project_root/tests/package_smoke.py" --source-root "$$project_root" \