From 5a346cef79664a830a463813f14591276f21bd61 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 22 Jan 2020 16:25:44 -0500 Subject: [PATCH] Delete .cache dir on wipe We are not deleting this directory, here is where PIP caches its packages. Users can still get the old (buggy) PIP version because of this. But why wiping worked for a lot of people? Because after wiping, we recreate the virtual environment and looks like PIP doesn't use the packages from the cache. But in the next build, when reusing the virtual environment, it will use the packages from the cache. --- readthedocs/core/utils/general.py | 1 + readthedocs/projects/tasks.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/readthedocs/core/utils/general.py b/readthedocs/core/utils/general.py index 9b7c41b21a9..34e4a34721e 100644 --- a/readthedocs/core/utils/general.py +++ b/readthedocs/core/utils/general.py @@ -20,6 +20,7 @@ def wipe_version_via_slugs(version_slug, project_slug): os.path.join(version.project.doc_path, 'checkouts', version.slug), os.path.join(version.project.doc_path, 'envs', version.slug), os.path.join(version.project.doc_path, 'conda', version.slug), + os.path.join(version.project.doc_path, '.cache', version.slug), ] for del_dir in del_dirs: broadcast(type='build', task=remove_dirs, args=[(del_dir,)]) diff --git a/readthedocs/projects/tasks.py b/readthedocs/projects/tasks.py index 5a065fd87a9..4de3860d9ea 100644 --- a/readthedocs/projects/tasks.py +++ b/readthedocs/projects/tasks.py @@ -1549,7 +1549,7 @@ def clean_build(version_pk): # because we are syncing the servers with an async task. del_dirs = [ os.path.join(version.project.doc_path, dir_, version.slug) - for dir_ in ('checkouts', 'envs', 'conda') + for dir_ in ('checkouts', 'envs', 'conda', '.cache') ] try: with version.project.repo_nonblockinglock(version):