Choosing between pip verbose logs and PyPI JSON API to diagnose failed package deployments
19.5K reputation · 24 Nov 2020, 20:54 UTC
Goal
Determine whether pip's verbose installation output or the PyPI JSON API provides more reliable information for diagnosing why a package failed to deploy from PyPI.
Constraints and uncertainty
Pip's verbose logs show each step of dependency resolution and HTTP interaction, but the level of detail varies between pip versions, and logs may not capture issues that occur before pip reaches the public index (e.g., mirror configuration or authentication problems).
The PyPI JSON API offers a complete view of released versions, yanked status, and dependencies as seen by a client with direct access to pypi.org, yet it cannot reveal problems caused by private indexes, proxies, or network restrictions that affect what pip actually sees.
Because the two sources complement each other, it is unclear which should be consulted first or whether both are needed depending on the nature of the failure (e.g., selection of a yanked version versus a timeout or authentication error).
- When a failure is due to a yanked version being selected, does the pip log or the JSON API more directly explain why that version was chosen?
- For failures caused by network timeouts or authentication errors, which source provides actionable details without requiring access to a private index?
- In environments that use a mirror or proxy, how can the JSON API be interpreted to match what pip actually observed?