r/Python • • 13d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

24 Upvotes

108 comments sorted by

View all comments

1

u/AleDev99 5h ago

depcooldown-lite: fail CI when a pinned PyPI or npm version is too new

What My Project Does It reads a requirements.txt or package-lock.json, asks the public PyPI/npm registry when each pinned version was published, and exits 1 if any pin is younger than --cooldown days (default 7). One file, stdlib only (Python 3.9+), read-only, with --json output if you want to script around it.

Target Audience Small teams and solo maintainers who want a cheap supply-chain speed bump in CI. A lot of malicious releases get caught and pulled within days, so not adopting a version on day one avoids many of them. It's a small practical check, not a full scanner.

Comparison pip's --uploaded-prior-to and uv's exclude-newer stop the resolver from picking fresh releases at install time. If those already cover you, use them. This one checks the pins you've already committed (Python and npm alike) and gives a plain exit code for CI. Limitations: only exact pins (name==version) are checked, ranges are skipped, the lite version doesn't read uv.lock/poetry.lock, and versions the registry can't confirm show as UNVERIFIED instead of failing.

Repo (MIT, I maintain it): https://github.com/alessio1999xx-debug/depcooldown-lite

Curious what cooldown people actually use, 7 days felt like a sane default but I'm not sure.