diff --git a/docs/rtd_requirements.txt b/docs/rtd_requirements.txt index 0fa1127b4..015c33a3e 100644 --- a/docs/rtd_requirements.txt +++ b/docs/rtd_requirements.txt @@ -1,3 +1,8 @@ twisted pyopenssl sphinxcontrib-napoleon +mock +pyxdg +service_identity +PIL +mako diff --git a/docs/source/conf.py b/docs/source/conf.py index 5a1502d90..87d80cf4f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -52,7 +52,7 @@ MOCK_MODULES = ['deluge.ui.languages', 'deluge.ui.countries', 'deluge.ui.gtkui.g 'libtorrent', 'psyco', 'rencode', 'twisted.web', 'twisted.web.client', 'twisted.web.error', 'win32file', 'win32event', 'win32gui', 'win32api', 'win32con', '_winreg', - 'pygtk', "gtk", "gobject", "gtk.gdk", "pango", "cairo", "pangocairo"] + 'pygtk', "gtk", "gobject", "gtk.gdk", "pango", "cairo", "pangocairo", "chardet"] for mod_name in MOCK_MODULES: sys.modules[mod_name] = Mock() diff --git a/tox.ini b/tox.ini index d9208aa8d..cec1c1847 100644 --- a/tox.ini +++ b/tox.ini @@ -107,25 +107,12 @@ deps = commands= sh -c "flake8 --max-complexity 10 deluge || true" -[testenv:docscoverage] -changedir=docs -install_command=pip install {opts} {packages} -deps = - {[testenv]deps} - sphinx - sphinxcontrib-napoleon - coverage - pytest-cov -whitelist_externals= - {[testenv]whitelist_externals} - mkdir - sphinx-build -commands= - mkdir -p build/doccoverage - sphinx-build -W -b coverage -d build/doctrees source build/doccoverage - py.test --doctest-glob='*.rst' +# We do not have all dependencies on RTD and travis so we exclude the +# site packages (sitepackages=False) when building docs so that local +# tests have a similar environment. -[testenv:docs] +[docsbase] +sitepackages=False changedir=docs install_command=pip install {opts} --allow-external PIL --allow-unverified PIL {packages} whitelist_externals= @@ -135,6 +122,32 @@ deps = {[testenv]deps} sphinx sphinxcontrib-napoleon + mock PIL commands= sphinx-build -E -W -b html -d build/doctrees source build/html + +[testenv:docs] +sitepackages={[docsbase]sitepackages} +changedir={[docsbase]changedir} +install_command={[docsbase]install_command} +whitelist_externals={[docsbase]whitelist_externals} +deps={[docsbase]deps} +commands= + sphinx-build -v -E -T -b html -d build/doctrees source build/html + +[testenv:docscoverage] +sitepackages={[docsbase]sitepackages} +changedir={[docsbase]changedir} +install_command={[docsbase]install_command} +whitelist_externals= + {[docsbase]whitelist_externals} + mkdir +deps= + {[docsbase]deps} + coverage + pytest-cov +commands= + mkdir -p build/doccoverage + sphinx-build -W -b coverage -d build/doctrees source build/doccoverage + py.test --doctest-glob='*.rst'