mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-03-16 22:20:27 +00:00
Move sphinx callback to a separate sphinx submodule
This commit is contained in:
parent
cd596f6788
commit
9592356572
6 changed files with 21 additions and 13 deletions
|
|
@ -25,11 +25,5 @@ def load_ipython_extension(ipython):
|
||||||
|
|
||||||
|
|
||||||
def setup(app=None):
|
def setup(app=None):
|
||||||
"""
|
"""Function used to initialize configurations similar to :func:`.django.setup`."""
|
||||||
The callback for Sphinx that acts as a Sphinx extension.
|
|
||||||
|
|
||||||
Add ``'configurations'`` to the ``extensions`` config variable
|
|
||||||
in your docs' ``conf.py``.
|
|
||||||
"""
|
|
||||||
_setup()
|
_setup()
|
||||||
return {'version': __version__, 'parallel_read_safe': True}
|
|
||||||
|
|
|
||||||
12
configurations/sphinx.py
Normal file
12
configurations/sphinx.py
Normal file
|
|
@ -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}
|
||||||
|
|
@ -224,8 +224,6 @@ As you can see django-configurations provides a helper module
|
||||||
Sphinx
|
Sphinx
|
||||||
------
|
------
|
||||||
|
|
||||||
.. versionadded: 0.9
|
|
||||||
|
|
||||||
In case you would like to user the amazing `autodoc` feature of the
|
In case you would like to user the amazing `autodoc` feature of the
|
||||||
documentation tool `Sphinx <http://sphinx-doc.org/>`_, you need add
|
documentation tool `Sphinx <http://sphinx-doc.org/>`_, you need add
|
||||||
django-configurations to your ``extensions`` config variable and set
|
django-configurations to your ``extensions`` config variable and set
|
||||||
|
|
@ -245,7 +243,11 @@ the environment variable accordingly:
|
||||||
'sphinx.ext.intersphinx',
|
'sphinx.ext.intersphinx',
|
||||||
'sphinx.ext.viewcode',
|
'sphinx.ext.viewcode',
|
||||||
# ...
|
# ...
|
||||||
'configurations',
|
'configurations.sphinx',
|
||||||
]
|
]
|
||||||
|
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
|
.. versionchanged:: 2.0
|
||||||
|
|
||||||
|
Please note that the sphinx callable has been moved from `configurations` to `configurations.sphinx`.
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.main")
|
||||||
os.environ.setdefault('DJANGO_CONFIGURATION', 'Test')
|
os.environ.setdefault('DJANGO_CONFIGURATION', 'Test')
|
||||||
|
|
||||||
extensions = [
|
extensions = [
|
||||||
'configurations',
|
'configurations.sphinx',
|
||||||
]
|
]
|
||||||
|
|
||||||
# The suffix of source filenames.
|
# The suffix of source filenames.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from django.test import TestCase
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
class ShpinxTests(TestCase):
|
class SphinxTests(TestCase):
|
||||||
docs_dir = os.path.join(settings.BASE_DIR, 'docs')
|
docs_dir = os.path.join(settings.BASE_DIR, 'docs')
|
||||||
|
|
||||||
def test_multiprocessing(self):
|
def test_multiprocessing(self):
|
||||||
|
|
|
||||||
2
tox.ini
2
tox.ini
|
|
@ -2,7 +2,7 @@
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
minversion = 1.8
|
minversion = 1.8
|
||||||
whitelist_externals=build-sphinx
|
whitelist_externals=sphinx-build
|
||||||
envlist =
|
envlist =
|
||||||
flake8-py27,
|
flake8-py27,
|
||||||
flake8-py35,
|
flake8-py35,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue