Repository navigation
Description
When some of a file's packages are kept off pypi.org (they come from an index that isn't known to be PyPI's) and the rest all have wheels, the verdict card still reads as a clean pass. #225 fixed the badge and the share line for this case. The headline, the green card and the platform tiles were left as they were.
To see it, run the driver under CPython, as tests/test_check_driver.py does, on a Pipfile.lock whose corp-utils comes from an index the lock doesn't describe:
{"_meta": {"sources": [{"name": "pypi", "url": "https://pypi.org/simple", "verify_ssl": true}]},
"default": {"idna": {"version": "==3.10"}, "corp-utils": {"version": "==1.0", "index": "corp"}},
"develop": {}}With PyPI's answer for idna==3.10, driver.check() returns packages: 1, private: ["corp-utils"] and {"wheel": 1, "source": 0, "missing": 0, "unknown": 0} for the target. The page then shows:
- the headline
✓ All 1 packages have a wheel for this target; - the card with the green
cleanclass; - a ✓ "all wheels" tile for each platform;
- and, below all that, an alert that says corp-utils wasn't checked.
Someone who reads the headline and stops there sees a pass for a project that was only partly checked. "All 1 packages have" is also wrong English, whenever a file has exactly one package.
Where
verdictText(h)insite/check/check-logic.mjswrites the headline.shareText()beside it already takesnotCheckedand never gives a ✓ when it is set.renderVerdict()insite/check/check.mjs:isCleanignoresr.private(only the badge checks it), and sets thecleanclass.tileText(c, outside)insite/check/check-logic.mjs, called fromrenderTargets().tests/site/check-page.test.mjs: thewithPrivatecase checks the badge and the "Fix it" heading only.
What to do
- Pass the number of packages that weren't checked (
r.private_count) toverdictText(), asshareText()gets it. With any, no ✓, and say it in the same words as the share line:All 1 checked package has a wheel for this target; 1 more wasn't checked (its index isn't known to be PyPI). isCleanis false when any package went unchecked, so the card isn't green.- A tile shows ✓ only when nothing went unchecked. Otherwise it shows
?with "N not checked", as it does for unknown packages. - Fix the singular everywhere
verdictText()counts: "1 package has", "All 2 packages have".
Done when:
-
tests/site/check-logic.test.mjs:verdictText()with 0, 1 and 2 packages not checked, and with 1 and 3 packages checked; no ✓ whenever one wasn't checked; singular and plural right. -
tests/site/check-logic.test.mjs:tileText()for a target whose checked packages all have wheels, with and without unchecked packages. -
tests/site/check-page.test.mjs: thewithPrivatecase also checks that the card has nocleanclass and that the headline has no ✓. - In the PR: before and after, as screenshots. A local page fed the result above is fine.
Activity