Repository navigation
Add offline checks to the Python lockfile API - #182
Conversation
Share the CLI offline preflight, reject missing file lists before lookups, and skip rechecks for Python versions outside the lock. AI assistance: OpenAI Codex helped implement and validate this change. Contributor review is required before upload.
…ngelog The README now says wheelgap.sources.SourceError, since it isn't exported from the top-level package, and the CHANGELOG bullet says that Python versions outside the lock may show false gaps when offline. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, @jwalith4418-Mj! This does what #172 asked, and moving the preflight into We've made these changes so it can go in:
It'll merge once CI and a final review pass. Nothing is needed from you. (Review assisted by Claude.) |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merged, thanks @jwalith4418-Mj! The second review confirmed that If you'd like another one, #178 builds on this. It puts the (Review assisted by Claude.) |
Closes #172.
What this changes
Add keyword-only
offline=Falsetocheck_lockfile(). Withoffline=True, reject inputs that need an index lookup and skip the automatic recheck for Python versions outside the lock. Those targets may show false gaps from the lock's incomplete wheel list; the README and API docstring explain that limitation. Rejectonline=True, offline=Truebefore loading input.Move the existing CLI preflight and its diagnostic helper into
offline.py, shared by the CLI and API without a circular import. API errors point tooffline=False; CLI messages keep their existing flag/config guidance. No changes to HTTP fetching or default checking behavior.AI tools used: OpenAI Codex. The contributor confirmed reading commit
8e3e849and running the checks before upload.Validation
On Ubuntu CPython 3.14.10:
uv run --group dev ruff format .,ruff check ., andmypypass.uv run --group dev pytest -q: 894 passed, 1 skipped, including the existing CLI offline/config diagnostics and online API recheck cases. Tests usefake_pypi, with assertions that offline checks make no requests.git diff --checkpasses.The changelog credits #182. Maintainer edits are welcome. The reviewed implementation patch was rebased unchanged onto a documentation-only upstream update before submission; the final additional commit adds only the PR attribution.