Skip to content

Commit 8d1a58d

Browse files
committed
Clean up setting names
1 parent eb7c4b2 commit 8d1a58d

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

readthedocs/doc_builder/config.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from readthedocs_build.config import load as load_config
99
from readthedocs_build.config import BuildConfig, ConfigError, InvalidConfig
1010

11-
from .constants import DOCKER_BUILD_IMAGES, DOCKER_IMAGE
11+
from .constants import DOCKER_IMAGE_SETTINGS, DOCKER_IMAGE
1212

1313

1414
class ConfigWrapper(object):
@@ -138,14 +138,16 @@ def load_yaml_config(version):
138138
# Get build image to set up the python version validation. Pass in the
139139
# build image python limitations to the loaded config so that the versions
140140
# can be rejected at validation
141-
build_image = DOCKER_BUILD_IMAGES.get(
142-
version.project.container_image,
143-
DOCKER_BUILD_IMAGES.get(DOCKER_IMAGE, None),
144-
)
145-
if build_image:
146-
env_config = {
147-
'python': build_image['python'],
141+
142+
img_name = version.project.container_image or DOCKER_IMAGE
143+
env_config = {
144+
'build': {
145+
'image': img_name,
148146
}
147+
}
148+
img_settings = DOCKER_IMAGE_SETTINGS.get(img_name, None)
149+
if img_settings:
150+
env_config.update(img_settings)
149151

150152
try:
151153
sphinx_env_config = env_config.copy()

readthedocs/doc_builder/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
)
3434
DOCKER_VERSION = getattr(settings, 'DOCKER_VERSION', 'auto')
3535
DOCKER_IMAGE = getattr(settings, 'DOCKER_IMAGE', 'readthedocs/build:2.0')
36-
DOCKER_BUILD_IMAGES = getattr(settings, 'DOCKER_BUILD_IMAGES', {})
36+
DOCKER_IMAGE_SETTINGS = getattr(settings, 'DOCKER_IMAGE_SETTINGS', {})
37+
3738
DOCKER_LIMITS = {'memory': '200m', 'time': 600}
3839
DOCKER_LIMITS.update(getattr(settings, 'DOCKER_LIMITS', {}))
3940

requirements/pip.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ six==1.10.0
1212
future==0.16.0
1313
#readthedocs-build==2.0.8
1414
# For testing
15-
git+https://github.com/rtfd/readthedocs-build.git@d93c81c#egg=readthedocs_build
15+
git+https://github.com/rtfd/readthedocs-build.git@73a184a#egg=readthedocs_build
1616

1717
django-tastypie==0.13.0
1818
django-haystack==2.6.0

0 commit comments

Comments
 (0)