diff --git a/.gitignore b/.gitignore index 0f9acd743..4472af150 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.swp .dir-locals.el +.cache/ .mypy_cache/ .ropeproject/ TAGS diff --git a/.travis.yml b/.travis.yml index 09b89a7ae..33c93038f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,15 +4,15 @@ cache: directories: - $HOME/.cache/pip python: + - "pypy" - "2.7" - "3.4" - "3.5" - "3.6" - "nightly" - - "pypy" env: global: - - TEST='-v --with-timer --timer-top-n 25' + - TEST='-v --durations 25' - PYTHONFAULTHANDLER=x - PYTHONWARNINGS=all matrix: diff --git a/CHANGES b/CHANGES index 3baa9c17c..d56bbd17b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,12 +1,18 @@ Release 1.5.2 (in development) =============================== +Incompatible changes +-------------------- + +* Dependency requirement updates: requests 2.4.0 or above (refs: #3268, #3310) + Features added -------------- * #3241: emit latex warning if buggy titlesec (ref #3210) * #3194: Refer the $MAKE environment variable to determine ``make`` command * Emit warning for nested numbered toctrees (refs: #3142) +* #978: `intersphinx_mapping` also allows a list as a parameter Bugs fixed ---------- @@ -21,6 +27,12 @@ Bugs fixed * The warning type ``misc.highlighting_failure`` does not work * #3294: ``add_latex_package()`` make crashes non-LaTeX builders * The caption of table are rendered as invalid HTML (refs: #3287) +* #3268: Sphinx crashes with requests package from Debian jessie +* #3284: Sphinx crashes on parallel build with an extension which raises + unserializable exception +* #3315: Bibliography crashes on latex build with docclass 'memoir' +* #3328: Could not refer rubric implicitly +* #3329: emit warnings if po file is invalid and can't read it. Also writing mo too. Release 1.5.1 (released Dec 13, 2016) diff --git a/Makefile b/Makefile index c515ce6eb..0b1a43435 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PYTHON ?= python DONT_CHECK = -i build -i dist -i sphinx/style/jquery.js \ -i sphinx/pycode/pgen2 -i sphinx/util/smartypants.py \ -i .ropeproject -i doc/_build -i tests/path.py \ - -i tests/coverage.py -i utils/convert.py \ + -i utils/convert.py \ -i tests/typing_test_data.py \ -i tests/test_autodoc_py35.py \ -i tests/roots/test-warnings/undecodable.rst \ @@ -65,6 +65,7 @@ clean-testfiles: rm -rf tests/.coverage rm -rf tests/build rm -rf .tox/ + rm -rf .cache/ clean-buildfiles: rm -rf build @@ -79,14 +80,13 @@ reindent: @$(PYTHON) utils/reindent.py -r -n . test: - @cd tests; $(PYTHON) run.py -I py35 -d -m '^[tT]est' $(TEST) + @cd tests; $(PYTHON) run.py --ignore py35 -v $(TEST) test-async: - @cd tests; $(PYTHON) run.py -d -m '^[tT]est' $(TEST) + @cd tests; $(PYTHON) run.py -v $(TEST) covertest: - @cd tests; $(PYTHON) run.py -d -m '^[tT]est' --with-coverage \ - --cover-package=sphinx $(TEST) + @cd tests; $(PYTHON) run.py -v --cov=sphinx --junitxml=.junit.xml $(TEST) build: @$(PYTHON) setup.py build diff --git a/doc/intl.rst b/doc/intl.rst index 005b03601..97f0e013e 100644 --- a/doc/intl.rst +++ b/doc/intl.rst @@ -94,14 +94,14 @@ This section describe a easy way to translate with sphinx-intl. $ make gettext - As a result, many pot files are generated under ``_build/locale`` + As a result, many pot files are generated under ``_build/gettext`` directory. #. Setup/Update your `locale_dir`: .. code-block:: console - $ sphinx-intl update -p _build/locale -l de -l ja + $ sphinx-intl update -p _build/gettext -l de -l ja Done. You got these directories that contain po files: diff --git a/setup.cfg b/setup.cfg index 2aad0c177..9aae11690 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,5 +25,5 @@ universal = 1 [flake8] max-line-length = 95 -ignore = E113,E116,E221,E226,E241,E251,E901 +ignore = E116,E241,E251 exclude = .git,.tox,tests/*,build/*,sphinx/search/*,sphinx/pycode/pgen2/*,doc/ext/example*.py \ No newline at end of file diff --git a/setup.py b/setup.py index 3582124ac..fa0be674f 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ requires = [ 'babel>=1.3,!=2.0', 'alabaster>=0.7,<0.8', 'imagesize', - 'requests', + 'requests>=2.4.0', ] extras_require = { # Environment Marker works for wheel 0.24 or later diff --git a/sphinx/__init__.py b/sphinx/__init__.py index e5768dcbe..2cd3a57de 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -30,7 +30,7 @@ if 'PYTHONWARNINGS' not in os.environ: warnings.filterwarnings('ignore', "'U' mode is deprecated", DeprecationWarning, module='docutils.io') -__version__ = '1.5.2+' +__version__ = '1.5.2+' __released__ = '1.5.2' # used when Sphinx builds its own docs # version info for better programmatic use diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index d4793ff4d..19a711370 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -368,8 +368,8 @@ Note: By default this script will not overwrite already created files.""") text += ' %s\n' % module d = dict( path = opts.destdir, - sep = False, - dot = '_', + sep = False, + dot = '_', project = opts.header, author = opts.author or 'Author', version = opts.version or '', diff --git a/sphinx/application.py b/sphinx/application.py index f3bc381bc..f38f6be47 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -258,7 +258,7 @@ class Sphinx(object): for catinfo in find_catalog_source_files( user_locale_dirs, self.config.language, domains=['sphinx'], charset=self.config.source_encoding): - catinfo.write_mo(self.config.language) + catinfo.write_mo(self.config.language, self.warn) locale_dirs = [None, path.join(package_dir, 'locale')] + user_locale_dirs else: locale_dirs = [] @@ -484,7 +484,7 @@ class Sphinx(object): summary = bold(summary) for item in iterable: l += 1 - s = '%s[%3d%%] %s' % (summary, 100*l/length, + s = '%s[%3d%%] %s' % (summary, 100 * l / length, colorfunc(stringify_func(item))) if self.verbosity: s += '\n' @@ -660,9 +660,9 @@ class Sphinx(object): else: # ignore invalid keys for compatibility continue - setattr(translator, 'visit_'+node.__name__, visit) + setattr(translator, 'visit_' + node.__name__, visit) if depart: - setattr(translator, 'depart_'+node.__name__, depart) + setattr(translator, 'depart_' + node.__name__, depart) def add_enumerable_node(self, node, figtype, title_getter=None, **kwds): self.enumerable_nodes[node] = (figtype, title_getter) diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index fe0c9c665..79713f392 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -167,7 +167,7 @@ class Builder(object): for catalog in self.app.status_iterator( catalogs, 'writing output... ', darkgreen, len(catalogs), cat2relpath): - catalog.write_mo(self.config.language) + catalog.write_mo(self.config.language, self.warn) def compile_all_catalogs(self): catalogs = i18n.find_catalog_source_files( diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py index a756742c9..eadbad09a 100644 --- a/sphinx/builders/changes.py +++ b/sphinx/builders/changes.py @@ -130,7 +130,7 @@ class ChangesBuilder(Builder): targetfn = path.join(self.outdir, 'rst', os_path(docname)) + '.html' ensuredir(path.dirname(targetfn)) with codecs.open(targetfn, 'w', 'utf-8') as f: - text = ''.join(hl(i+1, line) for (i, line) in enumerate(lines)) + text = ''.join(hl(i + 1, line) for (i, line) in enumerate(lines)) ctx = { 'filename': self.env.doc2path(docname, None), 'text': text diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 9160080c8..b9ab44676 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -498,7 +498,7 @@ class StandaloneHTMLBuilder(Builder): # additional pages from conf.py for pagename, template in self.config.html_additional_pages.items(): - self.info(' '+pagename, nonl=1) + self.info(' ' + pagename, nonl=1) self.handle_page(pagename, {}, template) # the search page @@ -953,7 +953,7 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder): hashindex = refuri.find('#') if hashindex < 0: continue - hashindex = refuri.find('#', hashindex+1) + hashindex = refuri.find('#', hashindex + 1) if hashindex >= 0: refnode['refuri'] = fname + refuri[hashindex:] @@ -1059,7 +1059,7 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder): # additional pages from conf.py for pagename, template in self.config.html_additional_pages.items(): - self.info(' '+pagename, nonl=1) + self.info(' ' + pagename, nonl=1) self.handle_page(pagename, {}, template) if self.config.html_use_opensearch: diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py index 79268ab74..11c614b5a 100644 --- a/sphinx/builders/htmlhelp.py +++ b/sphinx/builders/htmlhelp.py @@ -208,12 +208,12 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder): def build_hhx(self, outdir, outname): self.info('dumping stopword list...') - with self.open_file(outdir, outname+'.stp') as f: + with self.open_file(outdir, outname + '.stp') as f: for word in sorted(stopwords): print(word, file=f) self.info('writing project file...') - with self.open_file(outdir, outname+'.hhp') as f: + with self.open_file(outdir, outname + '.hhp') as f: f.write(project_template % { 'outname': outname, 'title': self.config.html_title, @@ -234,7 +234,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder): file=f) self.info('writing TOC file...') - with self.open_file(outdir, outname+'.hhc') as f: + with self.open_file(outdir, outname + '.hhc') as f: f.write(contents_header) # special books f.write('
  • ' + object_sitemap % (self.config.html_short_title, @@ -259,7 +259,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder): if ullevel != 0: f.write('\n') elif isinstance(node, addnodes.compact_paragraph): @@ -275,7 +275,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder): self.info('writing index file...') index = self.env.create_index(self) - with self.open_file(outdir, outname+'.hhk') as f: + with self.open_file(outdir, outname + '.hhk') as f: f.write('