Skip to content

Commit f4d3a93

Browse files
authored
Merge pull request #5039 from stsewd/remove-static-path
Remove sphinx static and template dir
2 parents 171b45c + 61852a2 commit f4d3a93

File tree

7 files changed

+3
-27
lines changed

7 files changed

+3
-27
lines changed

readthedocs/doc_builder/backends/sphinx.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from readthedocs.projects.models import Feature
2828

2929
from ..base import BaseBuilder, restoring_chdir
30-
from ..constants import PDF_RE, SPHINX_STATIC_DIR, SPHINX_TEMPLATE_DIR
30+
from ..constants import PDF_RE
3131
from ..environments import BuildCommand, DockerBuildCommand
3232
from ..exceptions import BuildEnvironmentError
3333
from ..signals import finalize_sphinx_context_data
@@ -63,7 +63,6 @@ def _write_config(self, master_doc='index'):
6363
'sphinx/conf.py.conf', {
6464
'project': self.project,
6565
'version': self.version,
66-
'template_dir': SPHINX_TEMPLATE_DIR,
6766
'master_doc': master_doc,
6867
})
6968
conf_file = os.path.join(docs_dir, 'conf.py')
@@ -114,8 +113,6 @@ def get_config_params(self):
114113
'project': self.project,
115114
'version': self.version,
116115
'settings': settings,
117-
'static_path': SPHINX_STATIC_DIR,
118-
'template_path': SPHINX_TEMPLATE_DIR,
119116
'conf_py_path': conf_py_path,
120117
'api_host': getattr(
121118
settings,

readthedocs/doc_builder/constants.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,12 @@
1212

1313
log = logging.getLogger(__name__)
1414

15-
SPHINX_TEMPLATE_DIR = os.path.join(
16-
settings.SITE_ROOT,
17-
'readthedocs',
18-
'templates',
19-
'sphinx',
20-
)
2115
MKDOCS_TEMPLATE_DIR = os.path.join(
2216
settings.SITE_ROOT,
2317
'readthedocs',
2418
'templates',
2519
'mkdocs',
2620
)
27-
SPHINX_STATIC_DIR = os.path.join(SPHINX_TEMPLATE_DIR, '_static')
2821

2922
PDF_RE = re.compile('Output written on (.*?)')
3023

readthedocs/doc_builder/environments.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
DOCKER_TIMEOUT_EXIT_CODE,
4444
DOCKER_VERSION,
4545
MKDOCS_TEMPLATE_DIR,
46-
SPHINX_TEMPLATE_DIR,
4746
)
4847
from .exceptions import (
4948
BuildEnvironmentCreationFailed,
@@ -866,10 +865,6 @@ def get_container_host_config(self):
866865
``client.create_container``.
867866
"""
868867
binds = {
869-
SPHINX_TEMPLATE_DIR: {
870-
'bind': SPHINX_TEMPLATE_DIR,
871-
'mode': 'ro',
872-
},
873868
MKDOCS_TEMPLATE_DIR: {
874869
'bind': MKDOCS_TEMPLATE_DIR,
875870
'mode': 'ro',

readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ if not 'html_static_path' in globals():
3737
html_static_path = []
3838
if os.path.exists('_static'):
3939
html_static_path.append('_static')
40-
html_static_path.append('{{ static_path }}')
4140

4241
# Add RTD Theme only if they aren't overriding it already
4342
using_rtd_theme = (

readthedocs/rtd_tests/files/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from recommonmark.parser import CommonMarkParser
88

99
extensions = []
10-
templates_path = ['/tmp/sphinx-template-dir', 'templates', '_templates', '.templates']
10+
templates_path = ['templates', '_templates', '.templates']
1111
source_suffix = ['.rst', '.md']
1212
source_parsers = {
1313
'.md': CommonMarkParser,

readthedocs/rtd_tests/tests/test_doc_builder.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ def test_conf_py_path(self, checkout_path, docs_dir):
7171
expected
7272
)
7373

74-
@patch(
75-
'readthedocs.doc_builder.backends.sphinx.SPHINX_TEMPLATE_DIR',
76-
'/tmp/sphinx-template-dir',
77-
)
7874
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.docs_dir')
7975
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.create_index')
8076
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.get_config_params')
@@ -131,10 +127,6 @@ def test_create_conf_py(
131127
ef.readlines()[:autogenerated_confpy_lines]
132128
)
133129

134-
@patch(
135-
'readthedocs.doc_builder.backends.sphinx.SPHINX_TEMPLATE_DIR',
136-
'/tmp/sphinx-template-dir',
137-
)
138130
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.docs_dir')
139131
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.create_index')
140132
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.get_config_params')

readthedocs/templates/sphinx/conf.py.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ from datetime import datetime
77
from recommonmark.parser import CommonMarkParser
88

99
extensions = []
10-
templates_path = ['{{ template_dir }}', 'templates', '_templates', '.templates']
10+
templates_path = ['templates', '_templates', '.templates']
1111
source_suffix = ['.rst', '.md']
1212
source_parsers = {
1313
'.md': CommonMarkParser,

0 commit comments

Comments
 (0)