From 3f1cd81efe416c60f548415dd228e14c73eeac9c Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 22 Nov 2017 15:48:18 -0500 Subject: [PATCH] Add GLOBAL_PIP_CACHE setting Avoid downloading over and over again the pip packages when you are developing over a slow internet connection. --- readthedocs/projects/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 9dc5a682367..ac8df36d6ce 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -441,6 +441,8 @@ def checkout_path(self, version=LATEST): @property def pip_cache_path(self): """Path to pip cache""" + if getattr(settings, 'GLOBAL_PIP_CACHE', False): + return settings.GLOBAL_PIP_CACHE return os.path.join(self.doc_path, '.cache', 'pip') #