diff --git a/.travis.yml b/.travis.yml index 82bcb9f23..09b89a7ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ python: - "2.7" - "3.4" - "3.5" + - "3.6" - "nightly" - "pypy" env: @@ -17,6 +18,16 @@ env: matrix: - DOCUTILS=0.12 - DOCUTILS=0.13.1 +matrix: + exclude: + - python: "3.4" + env: DOCUTILS=0.12 + - python: "3.5" + env: DOCUTILS=0.12 + - python: nightly + env: DOCUTILS=0.12 + - python: pypy + env: DOCUTILS=0.12 addons: apt: packages: @@ -31,8 +42,7 @@ install: - pip install -U pip setuptools - pip install docutils==$DOCUTILS - pip install -r test-reqs.txt -before_script: - - if [[ $TRAVIS_PYTHON_VERSION != '2.6' ]]; then flake8; fi script: - - if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then make style-check test-async; fi - - if [[ $TRAVIS_PYTHON_VERSION != '3.5' ]]; then make test; fi + - flake8 + - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then make style-check test-async; fi + - if [[ $TRAVIS_PYTHON_VERSION != '3.6' ]]; then make test; fi diff --git a/doc/install.rst b/doc/install.rst index b3519e1ba..2eb44b809 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -79,8 +79,8 @@ sidebar and under "Quick Links", click "Windows Installer" to download. .. note:: - Currently, Python offers two major versions, 2.x and 3.x. Sphinx 1.3 can run - under Python 2.7, 3.4, 3.5, with the recommended version being 2.7. This + Currently, Python offers two major versions, 2.x and 3.x. Sphinx 1.5 can run + under Python 2.7, 3.4, 3.5, 3.6, with the recommended version being 2.7. This chapter assumes you have installed Python 2.7. Follow the Windows installer for Python. diff --git a/setup.cfg b/setup.cfg index 533a71b0a..73ac1e746 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,6 +24,6 @@ directory = sphinx/locale/ universal = 1 [flake8] -max-line-length=95 -ignore=E113,E116,E221,E226,E241,E251,E901 -exclude=tests/*,build/*,sphinx/search/*,sphinx/pycode/pgen2/*,doc/ext/example*.py,.tox/* +max-line-length = 95 +ignore = E113,E116,E221,E226,E241,E251,E901 +exclude = .git,.tox,tests/*,build/*,sphinx/search/*,sphinx/pycode/pgen2/*,doc/ext/example*.py diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py index 96c520555..01be08cbd 100644 --- a/sphinx/builders/latex.py +++ b/sphinx/builders/latex.py @@ -285,14 +285,29 @@ def validate_config_values(app): app.config.latex_elements['postamble'] = app.config.latex_elements['footer'] +def default_latex_engine(config): + """ Better default latex_engine settings for specific languages. """ + if config.language == 'ja': + return 'platex' + else: + return 'pdflatex' + + +def default_latex_docclass(config): + """ Better default latex_docclass settings for specific languages. """ + if config.language == 'ja': + return {'manual': 'jsbook', + 'howto': 'jreport'} + else: + return {} + + def setup(app): # type: (Sphinx) -> Dict[unicode, Any] app.add_builder(LaTeXBuilder) app.connect('builder-inited', validate_config_values) - app.add_config_value('latex_engine', - lambda self: 'pdflatex' if self.language != 'ja' else 'platex', - None, + app.add_config_value('latex_engine', default_latex_engine, None, ENUM('pdflatex', 'xelatex', 'lualatex', 'platex')) app.add_config_value('latex_documents', lambda self: [(self.master_doc, make_filename(self.project) + '.tex', @@ -315,11 +330,7 @@ def setup(app): app.add_config_value('latex_elements', {}, None) app.add_config_value('latex_additional_files', [], None) - japanese_default = {'manual': 'jsbook', - 'howto': 'jreport'} - app.add_config_value('latex_docclass', - lambda self: japanese_default if self.language == 'ja' else {}, - None) + app.add_config_value('latex_docclass', default_latex_docclass, None) # now deprecated - use latex_elements app.add_config_value('latex_preamble', '', None) diff --git a/sphinx/search/__init__.py b/sphinx/search/__init__.py index d2baf363c..3f47983d3 100644 --- a/sphinx/search/__init__.py +++ b/sphinx/search/__init__.py @@ -448,7 +448,7 @@ class IndexBuilder(object): # type: () -> unicode if self.lang.js_stemmer_rawcode: return path.join( - path.dirname(path.abspath(__file__)), + sphinx.package_dir, 'search', 'non-minified-js', self.lang.js_stemmer_rawcode ) diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 8a899caa5..dfcadc6a1 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -50,7 +50,7 @@ def kpsetest(*filenames): except OSError: # no kpsewhich... either no tex distribution is installed or it is # a "strange" one -- don't bother running latex - return None + return False else: p.communicate() if p.returncode != 0: @@ -84,8 +84,8 @@ def compile_latex_document(app): def skip_if_stylefiles_notfound(testfunc): if kpsetest(*STYLEFILES) is False: - return skip_if(testfunc, - 'not running latex, the required styles do not seem to be installed') + msg = 'not running latex, the required styles do not seem to be installed' + return skip_if(True, msg)(testfunc) else: return testfunc diff --git a/tox.ini b/tox.ini index c14d1492f..6bcfc42eb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,20 +1,21 @@ [tox] -envlist=flake8,py27,py34,py35,pypy,du12,du11,du10 +envlist=flake8,py27,py34,py35,py36,pypy,du13,du12,du11 [testenv] deps= six nose - docutils sqlalchemy whoosh html5lib mock + enum34 typing setenv = SPHINX_TEST_TEMPDIR = {envdir}/testbuild + PYTHONDONTWRITEBYTECODE = true commands= - {envpython} -Wall tests/run.py -I py35 -m '^[tT]est' {posargs} + {envpython} -Wall tests/run.py --ignore-files=test_autodoc_py35 -m '^[tT]est' {posargs} sphinx-build -q -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html [testenv:pypy] @@ -22,11 +23,6 @@ deps= simplejson {[testenv]deps} -[testenv:du10] -deps= - docutils==0.10 - {[testenv]deps} - [testenv:du11] deps= docutils==0.11 @@ -37,13 +33,17 @@ deps= docutils==0.12 {[testenv]deps} +[testenv:du13] +deps= + docutils==0.13.1 + {[testenv]deps} + [testenv:flake8] deps=flake8 commands=flake8 [testenv:py27] deps= - enum34 {[testenv]deps} [testenv:py35]