I am running automated test suite and one of the test needs to install several Python packages with pip to make sure project scaffolds operate correctly.
However it is quite slowish operation to fetch packages from PyPi and cause unnecessary time burned during the test run. This is also a great source of random failures due to network connectivity errors. My plan was to create a cache tarball of known Python packages which are going to be installed. Then pip could consume packages directly from this tarball or extract it to a virtualenv for the test run.
Also the goal is to make this repeatable, so that the same cache (tarball) would be available on CI and local development.
Does there exist any tools or processes to create a redistributable Python package caches for pip?
Any other ideas how to do this in a platform agnostic way? I assume relocatable virtual environments are specific to target platform?