[Distutils] distlib.mount API design (was: wheels on sys.path clarification (reboot))

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Jan 31 10:38:41 CET 2014

On Fri, 31/1/14, Paul Moore <p.f.moore at gmail.com> wrote:

> Thanks for this. I see no means to set the cache that will be used by
> wheel.mount.

It's not as configurable as the distlib.resources cache (needs a method
to be overridden, which isn't ideal), but I'll look at making it follow the
same scheme.

> Are you meant to set the global distlib.resources.cache value to a user-
> created Cache instance if you want to control the location of the cache?


> Is the default cache created on demand? In other words, if I set up my
> own cache on application startup, will the %LOCALAPPDATA%\.distlib
> directory still get created?

No - currently it's created on module import by a line 'cache = Cache()'.
This can easily be changed to defer the cache creation until it's needed,
allowing user code to set a custom Cache. When I do this, no .distlib
directory will be created in %LOCALAPPDATA% unless no other
cache has been set, and it's needed.

> So I don't have an agenda here, I'm just curious.

I hope that answers things! I will update distlib's cache usage logic shortly
to (a) allow better control over the wheel mount cache location and (b)
create caches on demand rather than on module import.


Vinay Sajip

More information about the Distutils-SIG mailing list