Allow all numbered versions plus stable and latest as valid images
YAML v1 and v2 files allow the same Docker build images now,
1.0
2.0
3.0
4.0
stable
latest
Any new image added to DOCKER_IMAGE_SETTINGS will be automatically
picked as accepted for both YAML files.
@@ -147,6 +147,13 @@ class BuildConfigBase:
'mkdocs',
'submodules',
]
+
+ valid_build_images = {'stable', 'latest'}
+ for k in DOCKER_IMAGE_SETTINGS:
+ image, version = k.split(':')
+ if re.fullmatch(r'^[\d\.]+$', version):
+ valid_build_images.add(version)
+
default_build_image = DOCKER_DEFAULT_VERSION
version = None
@@ -288,13 +295,6 @@ class BuildConfigV1(BuildConfigBase):
'"python.extra_requirements" section must be a list.'
)
- # ConfigV1 accepts only numbered versions
- valid_build_images = set()
- for k in DOCKER_IMAGE_SETTINGS:
- image, version = k.split(':')
- if re.fullmatch(r'[\d\.]+', version):
- valid_build_images.add(version)
-
version = '1'
def get_valid_python_versions(self):
@@ -617,9 +617,6 @@ class BuildConfigV2(BuildConfigBase):
}
builders_display = dict(DOCUMENTATION_CHOICES)
- # Config V2 only accepts named versions
- valid_build_images = ['stable', 'latest']
-
def validate(self):
"""
Validates and process ``raw_config`` and ``env_config``.
