How I stopped re-resolving dependencies without rewriting pip

Published: (June 11, 2026 at 01:02 PM EDT)
2 min read
Source: Dev.to

Source: Dev.to

I got tired of watching pip think for at least 45 seconds before I could write a single line of code only to get back to waiting for dependency resolution and/or installation, so I built a hack that remembers the answer. I built a plug-and-play FastAPI engine ChaCC‑API that loads modules with their own requirements.txt. With every restart, it re‑resolved every module’s dependencies. Like running pip install over and over. In development, with a medium‑sized module, that meant 45 seconds of waiting. Even when nothing changed. Restart server? Wait. Edit a module? Wait. Add a module? Wait again. I built chacc-dependency-manager. It does one smart thing though very small :) Cache the result of pip-compile. cache_key = hash(requirements + python_version + os) if cache_key in cache: pinned = cache[cache_key] # use saved answer else: pinned = run_pip_compile() # solve once (slow) cache[cache_key] = pinned

Only install what’s actually missing

install_missing_packages(pinned)

No extra resolver runs. No unnecessary pip install calls. Just remember the plan, then do only what’s needed. First run (or after requirements change): ~45 seconds (resolve + install) Cache hit (no changes): <2 seconds (skip resolution, install only missing packages – usually nothing) In my dev workflow, that 45‑second wait on every restart is now gone when dependencies are stable. But be real: If you’re actively editing requirements.txt, you’ll pay the price if not worse each time you change it. This hack shines when you’re not changing dependencies often, exactly my case. Resolve conflicts – still uses pip-compile for that. Make cold installs faster – first run is full price. Beat uv in a speed contest - if you’re starting fresh, just use uv. It’s faster and smarter. Warn you about version conflicts across modules – those will still surface at install time. It’s a tiny caching wrapper for a specific modular workflow. That’s it. Standalone or try and use ChaCC‑API (toggle ENABLE_PLUGIN_DEPENDENCY_RESOLUTION) to see it in action. 🔗 GitHub

🔗 PyPI What’s your “I just want to cache this” story? #buildinpublic #pip

0 views
Back to Blog

Related posts

Read more »

The spec is in the wrong place

My day job is at a large tech company. Hundreds of engineering teams, and every one of them is somewhere different on AI adoption. Some are still treating codin...

The Heuristics Say Don't

A culture that only records its disasters ends up with a biased archive. Wars documented, plagues chronicled, collapses catalogued. The quiet decades go unwritt...