mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'stable'
This commit is contained in:
commit
bd382528d0
18
.travis.yml
18
.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
|
||||
|
@ -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.
|
||||
|
@ -26,4 +26,4 @@ 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/*
|
||||
exclude = .git,.tox,tests/*,build/*,sphinx/search/*,sphinx/pycode/pgen2/*,doc/ext/example*.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)
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -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
|
||||
|
||||
|
18
tox.ini
18
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]
|
||||
|
Loading…
Reference in New Issue
Block a user