On 2 Feb 2016, at 12:23, Paul Moore wrote:
I want to have a devpi instance I can use for offline use. The server will be in offline mode 99% of the time, and only online when I make a special effort. So I want a way to "preload" the PyPI cache so that packages I might need for offline use are available. I'd expect to maybe go online once a week or so (possibly less, depends on how much development activity I'm doing at the time), and refresh the cache with latest versions.
What's the best way of doing this? One option would be to do something like "pip download -r requirements.txt" to refresh all the packages in the given requirements file. I guess that would probably work, but it feels a bit clunky. And it doesn't really give me a way of doing anything more complex (for example, removing older versions of packages that I no longer need to have cached). Is there a better way to manage the cache?
Currently there is no better way. You might be able to write a small script or modify pip to only request the HEAD of the download URL. That way the devpi-server will download the package, but you don't have to download it from devpi. I think there is no way currently to remove old versions besides going through the files directly. A plugin to devpi-server using some internals could implement that though. Regards, Florian Schulze