-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from codingjoe/issues/146
Fixes #146 -- Adds multiprocessing support for sphinx
- Loading branch information
Showing
9 changed files
with
75 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from . import _setup, __version__ | ||
|
||
|
||
def setup(app=None): | ||
""" | ||
The callback for Sphinx that acts as a Sphinx extension. | ||
Add ``'configurations'`` to the ``extensions`` config variable | ||
in your docs' ``conf.py``. | ||
""" | ||
_setup() | ||
return {'version': __version__, 'parallel_read_safe': True} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) | ||
|
||
# setup Django | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.main") | ||
os.environ.setdefault('DJANGO_CONFIGURATION', 'Test') | ||
|
||
extensions = [ | ||
'configurations.sphinx', | ||
] | ||
|
||
# The suffix of source filenames. | ||
source_suffix = '.rst' | ||
|
||
# The master toctree document. | ||
master_doc = 'index' | ||
|
||
# General information about the project. | ||
project = 'django-configurations' | ||
copyright = '2012-2014, Jannis Leidel and other contributors' | ||
|
||
|
||
version = release = 'test' | ||
|
||
exclude_patterns = ['_build'] | ||
|
||
html_theme = 'default' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Test Documentation | ||
^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ dj-email-url | |
dj-search-url | ||
django-cache-url>=1.0.0 | ||
six | ||
Sphinx>=1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
import subprocess | ||
import os | ||
|
||
from django.test import TestCase | ||
from django.conf import settings | ||
|
||
|
||
class SphinxTests(TestCase): | ||
docs_dir = os.path.join(settings.BASE_DIR, 'docs') | ||
|
||
def test_multiprocessing(self): | ||
output = subprocess.check_output([ | ||
'sphinx-build', | ||
'-b', | ||
'html', | ||
'-j 2', | ||
'.', | ||
'_build/html', | ||
], cwd=self.docs_dir, stderr=subprocess.STDOUT) | ||
self.assertIn(b'waiting for workers', output) | ||
self.assertIn(b'build succeeded.', output) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters