File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -148,12 +148,6 @@ class BuildConfigBase:
148
148
'submodules' ,
149
149
]
150
150
151
- valid_build_images = {'stable' , 'latest' }
152
- for k in DOCKER_IMAGE_SETTINGS :
153
- image , version = k .split (':' )
154
- if re .fullmatch (r'^[\d\.]+$' , version ):
155
- valid_build_images .add (version )
156
-
157
151
default_build_image = DOCKER_DEFAULT_VERSION
158
152
version = None
159
153
@@ -255,6 +249,22 @@ def python_full_version(self):
255
249
)
256
250
return ver
257
251
252
+ @property
253
+ def valid_build_images (self ):
254
+ """
255
+ Return all the valid Docker image choices for ``build.image`` option.
256
+
257
+ The user can use any of this values in the YAML file. These values are
258
+ the keys of ``DOCKER_IMAGE_SETTINGS`` Django setting (without the
259
+ ``readthedocs/build`` part) plus ``stable`` and ``latest``.
260
+ """
261
+ images = {'stable' , 'latest' }
262
+ for k in DOCKER_IMAGE_SETTINGS :
263
+ image , version = k .split (':' )
264
+ if re .fullmatch (r'^[\d\.]+$' , version ):
265
+ images .add (version )
266
+ return images
267
+
258
268
def get_valid_python_versions_for_image (self , build_image ):
259
269
"""
260
270
Return all the valid Python versions for a Docker image.
You can’t perform that action at this time.
0 commit comments