Skip to content

Commit e1800a0

Browse files
humitosericholscher
authored andcommitted
Use --cache-dir on pip if CACHED_ENVIRONMENT is enabled
1 parent ae4dd59 commit e1800a0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

readthedocs/doc_builder/python_environments.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,15 @@ def _pip_cache_cmd_argument(self):
129129
130130
The decision is made considering if the directories are going to be
131131
cleaned after the build (``RTD_CLEAN_AFTER_BUILD=True`` or project has
132-
the ``CLEAN_AFTER_BUILD`` feature enabled). In this case, there is no
133-
need to cache anything.
132+
the ``CLEAN_AFTER_BUILD`` feature enabled) and project has not the
133+
feature ``CACHED_ENVIRONMENT``. In this case, there is no need to cache
134+
anything.
134135
"""
135136
if (
136-
settings.RTD_CLEAN_AFTER_BUILD or
137-
self.project.has_feature(Feature.CLEAN_AFTER_BUILD)
137+
(
138+
settings.RTD_CLEAN_AFTER_BUILD or
139+
self.project.has_feature(Feature.CLEAN_AFTER_BUILD)
140+
) and not self.project.has_feature(Feature.CACHED_ENVIRONMENT)
138141
):
139142
return [
140143
'--no-cache-dir',

0 commit comments

Comments
 (0)