diff --git a/readthedocs/doc_builder/backends/mkdocs.py b/readthedocs/doc_builder/backends/mkdocs.py index c25c88d470a..f80998c9fb4 100644 --- a/readthedocs/doc_builder/backends/mkdocs.py +++ b/readthedocs/doc_builder/backends/mkdocs.py @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- - """ MkDocs_ backend for building docs. .. _MkDocs: http://www.mkdocs.org/ """ + import json import logging import os diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py index 9273ab2bba0..61258b269bc 100644 --- a/readthedocs/doc_builder/python_environments.py +++ b/readthedocs/doc_builder/python_environments.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """An abstraction over virtualenv and Conda environments.""" import copy @@ -9,8 +7,6 @@ import os import shutil -from django.conf import settings - from readthedocs.config import PIP, SETUPTOOLS from readthedocs.config.models import PythonInstall, PythonInstallRequirements from readthedocs.doc_builder.config import load_yaml_config @@ -295,7 +291,13 @@ def install_core_requirements(self): ] if self.config.doctype == 'mkdocs': - requirements.append('mkdocs==0.17.3') + requirements.append( + self.project.get_feature_value( + Feature.DEFAULT_TO_MKDOCS_0_17_3, + positive='mkdocs==0.17.3', + negative='mkdocs<1.1', + ), + ) else: # We will assume semver here and only automate up to the next # backward incompatible release: 2.x diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index fab466a58f5..63495515cae 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -1312,6 +1312,7 @@ def add_features(sender, **kwargs): USE_TESTING_BUILD_IMAGE = 'use_testing_build_image' SHARE_SPHINX_DOCTREE = 'share_sphinx_doctree' USE_PDF_LATEXMK = 'use_pdf_latexmk' + DEFAULT_TO_MKDOCS_0_17_3 = 'default_to_mkdocs_0_17_3' FEATURES = ( (USE_SPHINX_LATEST, _('Use latest version of Sphinx')), @@ -1346,6 +1347,10 @@ def add_features(sender, **kwargs): SHARE_SPHINX_DOCTREE, _('Use shared directory for doctrees'), ), + ( + DEFAULT_TO_MKDOCS_0_17_3, + _('Install mkdocs 0.17.3 by default') + ), ) projects = models.ManyToManyField(