Improve docs build
Starting in Django 1.7, standalone scripts, such as a sphinx build require that django.setup() be called first. See: https://docs.djangoproject.com/en/1.8/releases/1.7/#standalone-scripts It does not always necessary, but it is needed to avoid warnings when creating autoindex. Note that horizon no longer generates the autoindex to avoid warnings. Drops setenv DJANGO_SETTINGS_MODULE in docs env in tox.ini. DJANGO_SETTINGS_MODULE is configured in doc/source/conf.py, so there is no need to pass envvar. Add warning-is-error sphinx setting to avoid doc build warnings. Change-Id: I2de87c0df05abf589c90fb3ad691322e1125c310
This commit is contained in:
parent
83caa004e2
commit
e965dc233e
@ -28,6 +28,8 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import django
|
||||||
|
|
||||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
|
ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
|
||||||
|
|
||||||
@ -37,8 +39,12 @@ sys.path.insert(0, ROOT)
|
|||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
|
||||||
'magnum_ui.test.settings')
|
'magnum_ui.test.settings')
|
||||||
|
|
||||||
from magnum_ui \
|
# Starting in Django 1.7, standalone scripts, such as a sphinx build
|
||||||
import version as magnumui_ver
|
# require that django.setup() be called first.
|
||||||
|
# https://docs.djangoproject.com/en/1.8/releases/1.7/#standalone-scripts
|
||||||
|
django.setup()
|
||||||
|
|
||||||
|
from magnum_ui import version as magnumui_ver
|
||||||
|
|
||||||
|
|
||||||
def write_autodoc_index():
|
def write_autodoc_index():
|
||||||
@ -270,7 +276,7 @@ html_theme_options = {
|
|||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
html_static_path = ['']
|
||||||
|
|
||||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||||
# using the given strftime format.
|
# using the given strftime format.
|
||||||
|
@ -26,3 +26,4 @@ packages =
|
|||||||
all_files = 1
|
all_files = 1
|
||||||
build-dir = doc/build
|
build-dir = doc/build
|
||||||
source-dir = doc/source
|
source-dir = doc/source
|
||||||
|
warning-is-error = 1
|
||||||
|
1
tox.ini
1
tox.ini
@ -57,7 +57,6 @@ commands =
|
|||||||
echo "execute `npm run test`"
|
echo "execute `npm run test`"
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
setenv = DJANGO_SETTINGS_MODULE=magnum_ui.test.settings
|
|
||||||
commands = python setup.py build_sphinx
|
commands = python setup.py build_sphinx
|
||||||
|
|
||||||
[testenv:releasenotes]
|
[testenv:releasenotes]
|
||||||
|
Loading…
Reference in New Issue
Block a user