Merge "Improve docs build"
This commit is contained in:
commit
7ebd9e9bda
@ -28,6 +28,8 @@ import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import django
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
|
||||
|
||||
@ -37,8 +39,12 @@ sys.path.insert(0, ROOT)
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
|
||||
'{{ cookiecutter.module_name }}.test.settings')
|
||||
|
||||
from {{ cookiecutter.module_name }} \
|
||||
import version as ui_ver
|
||||
# Starting in Django 1.7, standalone scripts, such as a sphinx build
|
||||
# require that django.setup() be called first.
|
||||
# https://docs.djangoproject.com/en/1.8/releases/1.7/#standalone-scripts
|
||||
django.setup()
|
||||
|
||||
from {{ cookiecutter.module_name }} import version as ui_ver
|
||||
|
||||
|
||||
def write_autodoc_index():
|
||||
|
@ -26,3 +26,4 @@ packages =
|
||||
all_files = 1
|
||||
build-dir = doc/build
|
||||
source-dir = doc/source
|
||||
warning-is-error = 1
|
||||
|
@ -60,7 +60,6 @@ commands =
|
||||
echo "nexecute `npm run test`"
|
||||
|
||||
[testenv:docs]
|
||||
setenv = DJANGO_SETTINGS_MODULE={{cookiecutter.module_name}}.test.settings
|
||||
commands = python setup.py build_sphinx
|
||||
|
||||
[testenv:releasenotes]
|
||||
|
Loading…
Reference in New Issue
Block a user