Skip to content

Commit 991734f

Browse files
committed
Reuse get_conf_py_path for mkdocs
1 parent 50be426 commit 991734f

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

readthedocs/builds/models.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,6 @@ def get_conf_py_path(self):
540540
conf_py_path = os.path.relpath(conf_py_path, checkout_prefix)
541541
return conf_py_path
542542

543-
def get_mkdocs_yml_path(self):
544-
mkdocs_yml_path = self.project.yaml_dir(self.slug)
545-
checkout_prefix = self.project.checkout_path(self.slug)
546-
mkdocs_yml_path = os.path.relpath(mkdocs_yml_path, checkout_prefix)
547-
return mkdocs_yml_path
548-
549543
def get_storage_paths(self, version_slug=None):
550544
"""
551545
Return a list of all build artifact storage paths for this version.

readthedocs/projects/models.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -984,12 +984,7 @@ def conf_dir(self, version=LATEST):
984984
conf_file = self.conf_file(version)
985985
if conf_file:
986986
return os.path.dirname(conf_file)
987-
988-
def yaml_dir(self, version=LATEST):
989-
yaml_file = self.yaml_file(version)
990-
if yaml_file:
991-
return os.path.dirname(yaml_file)
992-
987+
993988
@property
994989
def has_good_build(self):
995990
# Check if there is `_good_build` annotation in the Queryset.

readthedocs/rtd_tests/tests/test_doc_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def setUp(self):
138138

139139
@patch("readthedocs.doc_builder.backends.mkdocs.BaseMkdocs.docs_dir")
140140
@patch("readthedocs.doc_builder.backends.mkdocs.BaseMkdocs.run")
141-
@patch("readthedocs.builds.models.Version.get_mkdocs_yml_path")
141+
@patch("readthedocs.builds.models.Version.get_conf_py_path")
142142
@patch("readthedocs.projects.models.Project.checkout_path")
143143
@patch("readthedocs.doc_builder.python_environments.load_yaml_config")
144144
def test_project_without_mkdocs_yaml(

0 commit comments

Comments
 (0)