-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Use default settings for Config object #5056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
593af88
da4a1c4
c57a0a4
12e7c35
f5fea83
5d7ead4
32e7559
c0dda3b
1b7912e
555f0fb
5891db3
b88b167
77102a1
7c905c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
from contextlib import contextmanager | ||
|
||
import six | ||
from django.conf import settings | ||
|
||
from readthedocs.projects.constants import DOCUMENTATION_CHOICES | ||
|
||
|
@@ -55,28 +56,12 @@ | |
INVALID_KEYS_COMBINATION = 'invalid-keys-combination' | ||
INVALID_KEY = 'invalid-key' | ||
|
||
DOCKER_DEFAULT_IMAGE = 'readthedocs/build' | ||
DOCKER_DEFAULT_VERSION = '2.0' | ||
DOCKER_DEFAULT_IMAGE = getattr(settings, 'DOCKER_DEFAULT_IMAGE', 'readthedocs/build') | ||
DOCKER_DEFAULT_VERSION = getattr(settings, 'DOCKER_DEFAULT_VERSION', '2.0') | ||
# These map to corresponding settings in the .org, | ||
# so they haven't been renamed. | ||
DOCKER_IMAGE = '{}:{}'.format(DOCKER_DEFAULT_IMAGE, DOCKER_DEFAULT_VERSION) | ||
DOCKER_IMAGE_SETTINGS = { | ||
'readthedocs/build:1.0': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.4]}, | ||
}, | ||
'readthedocs/build:2.0': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.5]}, | ||
}, | ||
'readthedocs/build:3.0': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.3, 3.4, 3.5, 3.6]}, | ||
}, | ||
'readthedocs/build:stable': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.3, 3.4, 3.5, 3.6]}, | ||
}, | ||
'readthedocs/build:latest': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.3, 3.4, 3.5, 3.6]}, | ||
}, | ||
} | ||
DOCKER_IMAGE = getattr(settings, 'DOCKER_IMAGE', 'readthedocs/build:2.0') | ||
dojutsu-user marked this conversation as resolved.
Show resolved
Hide resolved
|
||
DOCKER_IMAGE_SETTINGS = getattr(settings, 'CONFIG_DOCKER_IMAGE_SETTINGS', {}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why I suppose it just should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't get you. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have been using Regarding the test, please take a look to see if you can fix it or find the reason why it's failing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Earlier, Reason for test failure: add some more items to the dictionary and hence the This can be fixed pretty easily in two ways:
I am +1 on first option and -0 on the second and would like to know that what is a better option? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the test is not about docker images and python versions, mocking as empty dict is the way to go. On the other, if we want to be sure about some specific value on that dictionary, we should mock it with that specific value. Changing the expected call with the values of that setting is tricky, because then we will add another docker image and the test will fail again. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually the test is related to the docker image and python versions, so i added the the missing key-values in the |
||
|
||
|
||
class ConfigError(Exception): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,6 +269,27 @@ def USE_PROMOS(self): # noqa | |
# Docker | ||
DOCKER_ENABLE = False | ||
DOCKER_IMAGE = 'readthedocs/build:2.0' | ||
dojutsu-user marked this conversation as resolved.
Show resolved
Hide resolved
|
||
DOCKER_DEFAULT_IMAGE = 'readthedocs/build' | ||
DOCKER_DEFAULT_VERSION = '2.0' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
# Settings for config object | ||
CONFIG_DOCKER_IMAGE_SETTINGS = { | ||
'readthedocs/build:1.0': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.4]}, | ||
}, | ||
'readthedocs/build:2.0': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.5]}, | ||
}, | ||
'readthedocs/build:3.0': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.3, 3.4, 3.5, 3.6]}, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'readthedocs/build:4.0': {
'python': {'supported_versions': [2, 2.7, 3, 3.5, 3.6, 3.7]},
}, has to be added here. |
||
'readthedocs/build:stable': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.3, 3.4, 3.5, 3.6]}, | ||
}, | ||
'readthedocs/build:latest': { | ||
'python': {'supported_versions': [2, 2.7, 3, 3.3, 3.4, 3.5, 3.6]}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}, | ||
} | ||
|
||
# All auth | ||
ACCOUNT_ADAPTER = 'readthedocs.core.adapters.AccountAdapter' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should default to
3.0
now that we already deploy/release it.