The Day I Became the One Being pip Installed: My Pre-Release Checks Caught 3 Leaks
说明与用途
开发者使用自动化预发布检查将 triage‑lens CLI 发布到 PyPI,防止测试代码、私有仓库名称和链接错误泄露,并在发布后验证版本可见性和 README 正确性。
问题
Ensuring that a Python package published to PyPI contains no unintended test code, private repo names, or broken links, and that post‑release artifacts are correctly reflected on PyPI.
结果
All three pre‑release leaks were caught and fixed before publication, and post‑release checks prevented stale or missing releases from being exposed to users.
工作流
- 1. Configure GitHub Actions workflow for release
- 2. Use Trusted Publishing (OIDC) for PyPI authentication
- 3. Run mechanical pre‑release checks: exclude test files, verify no private repo name leaks, ensure README links are absolute
- 4. Build distribution wheel and source archive
- 5. Publish to PyPI
- 6. Verify new version is visible to pip before running smoke test
- 7. Update README on GitHub if needed and re‑publish if stale
- 8. Monitor download counts and usage metrics
证据
In this project, nothing goes out to a public repository without passing a mechanical check.
The packaging tool's default behavior had a path where the whole development test suite gets bundled along.
The name of my private development repository was about to appear in a published artifact.
The description shown on the PyPI page is baked into the artifact at the moment you publish.
- 记录日期: 2026-09-05T18:15:02.694Z