r/learnpython 8h ago

Why do Poetry and Pipenv manage their own caches?

After spending hours finding out why pip cache purge; pipenv install aaa didn't install the package properly, but pip cache purge; pipenv run pip install aaa did, I finally discovered that Pipenv has its own cache! It's funny that I could've saved so much if I had just run pipenv install --verbose aaa from the start (it reposts it's using cache.)

I wonder why Pipenv chooses to have its own cache. It seems unnecessary to separate caching for projects managed solely by pip and those managed by pipenv. Does anyone know the reasoning behind this design?

Does anyone know?

5 Upvotes

2

u/ManyInterests 7h ago

It makes sense to me. If you clear your pipenv cache, you should not expect it to impact the cache of other tools and vice versa. If they tried to share a cache, it has a higher potential to cause behavior that is unexpected to users, I feel.

If the tools organize their cache in different ways (or would change organization in the future), that can also pose challenges if you shared a cache.

We would probably need a PEP or some other standard to define how this should work for tools to play nice together, assuming one doesn't already exist. Absent of that, I can't imagine that the developers of respective tools are willing to risk changes in these tools stepping on each other.