Skip to content
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

Build: remove support for MkDocs <= 0.17.3 #10584

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions readthedocs/doc_builder/backends/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,7 @@ def append_conf(self):
)

user_config['docs_dir'] = docs_dir

# MkDocs <=0.17.x doesn't support absolute paths,
# it needs one with a full domain.
if self.project.has_feature(Feature.DEFAULT_TO_MKDOCS_0_17_3):
static_url = get_absolute_static_url()
else:
static_url = self.project.proxied_static_path
static_url = self.project.proxied_static_path

# Set mkdocs config values.
extra_assets = {
Expand Down
8 changes: 1 addition & 7 deletions readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,7 @@ def _install_old_requirements(self, pip_install_cmd):
)

if self.config.doctype == 'mkdocs':
requirements.append(
self.project.get_feature_value(
Feature.DEFAULT_TO_MKDOCS_0_17_3,
positive='mkdocs==0.17.3',
negative="mkdocs",
)
)
requirements.append("mkdocs")
else:
requirements.extend(
[
Expand Down
5 changes: 0 additions & 5 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,6 @@ def add_features(sender, **kwargs):
USE_NEW_PIP_RESOLVER = 'use_new_pip_resolver'
DONT_INSTALL_LATEST_PIP = 'dont_install_latest_pip'
USE_SPHINX_LATEST = 'use_sphinx_latest'
DEFAULT_TO_MKDOCS_0_17_3 = 'default_to_mkdocs_0_17_3'
USE_SPHINX_RTD_EXT_LATEST = 'rtd_sphinx_ext_latest'
INSTALL_LATEST_CORE_REQUIREMENTS = "install_latest_core_requirements"

Expand Down Expand Up @@ -1999,10 +1998,6 @@ def add_features(sender, **kwargs):
_("Build: Don't install the latest version of pip"),
),
(USE_SPHINX_LATEST, _("Sphinx: Use latest version of Sphinx")),
(
DEFAULT_TO_MKDOCS_0_17_3,
_("MkDOcs: Install mkdocs 0.17.3 by default"),
),
(
USE_SPHINX_RTD_EXT_LATEST,
_("Sphinx: Use latest version of the Read the Docs Sphinx extension"),
Expand Down
63 changes: 0 additions & 63 deletions readthedocs/rtd_tests/tests/test_doc_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,69 +367,6 @@ def test_append_conf_existing_yaml_on_root(self, checkout_path, run):
"mkdocs",
)

@patch("readthedocs.doc_builder.base.BaseBuilder.run")
@patch("readthedocs.projects.models.Project.checkout_path")
def test_append_conf_mkdocs_07x(self, checkout_path, run):
get(
Feature,
feature_id=Feature.DEFAULT_TO_MKDOCS_0_17_3,
projects=[self.project],
)
tmpdir = tempfile.mkdtemp()
os.mkdir(os.path.join(tmpdir, "docs"))
yaml_file = os.path.join(tmpdir, "mkdocs.yml")
yaml.safe_dump(
{
"site_name": "mkdocs",
"google_analytics": ["UA-1234-5", "mkdocs.org"],
"docs_dir": "docs",
},
open(yaml_file, "w"),
)
checkout_path.return_value = tmpdir

python_env = Virtualenv(
version=self.version,
build_env=self.build_env,
config=None,
)
builder = MkdocsHTML(
build_env=self.build_env,
python_env=python_env,
)
with override_settings(DOCROOT=tmpdir):
builder.append_conf()

run.assert_called_with('cat', 'mkdocs.yml', cwd=mock.ANY)

config = yaml_load_safely(open(yaml_file))
self.assertEqual(
config['docs_dir'],
'docs',
)
self.assertEqual(
config['extra_css'],
[
'http://readthedocs.org/static/css/badge_only.css',
'http://readthedocs.org/static/css/readthedocs-doc-embed.css',
],
)
self.assertEqual(
config['extra_javascript'],
[
'readthedocs-data.js',
'http://readthedocs.org/static/core/js/readthedocs-doc-embed.js',
'http://readthedocs.org/static/javascript/readthedocs-analytics.js',
],
)
self.assertIsNone(
config['google_analytics'],
)
self.assertEqual(
config['site_name'],
'mkdocs',
)

@patch('readthedocs.doc_builder.base.BaseBuilder.run')
@patch('readthedocs.projects.models.Project.checkout_path')
def test_append_conf_existing_yaml_on_root_with_invalid_setting(self, checkout_path, run):
Expand Down