sphinx-contrib / sphinxcontrib-versioning

Sphinx extension that allows building versioned docs for self-hosting.
https://sphinxcontrib-versioning.readthedocs.io/en/latest/
MIT License
127 stars 80 forks source link

Fix KeyError when banner tag fails to build. #27

Closed Robpol86 closed 7 years ago

Robpol86 commented 7 years ago
# Sphinx version: 1.4.8
# Python version: 3.5.1 (CPython)
# Docutils version: 0.13.1 release
# Jinja2 version: 2.8
# Last messages:
#   
#   looking for now-outdated files...
#   none found
#   pickling environment...
#   done
#   checking consistency...
#   done
#   preparing documents...
#   done
#   writing output... [ 10%] banner
# Loaded extensions:
#   sphinxcontrib.googleanalytics (0.1) from /Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinxcontrib/googleanalytics.py
#   alabaster (0.7.9) from /Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/alabaster/__init__.py
#   sphinxcontrib.versioning.sphinx_ (2.2.0) from /Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinxcontrib/versioning/sphinx_.py
Traceback (most recent call last):
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/cmdline.py", line 244, in main
    app.build(opts.force_all, filenames)
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/application.py", line 297, in build
    self.builder.build_update()
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 251, in build_update
    'out of date' % len(to_build))
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 322, in build
    self.write(docnames, list(updated_docnames), method)
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 360, in write
    self._write_serial(sorted(docnames), warnings)
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 368, in _write_serial
    self.write_doc(docname, doctree)
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/builders/html.py", line 454, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/builders/html.py", line 810, in handle_page
    templatename, ctx, event_arg)
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/application.py", line 555, in emit_firstresult
    for result in self.emit(event, *args):
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinx/application.py", line 551, in emit
    results.append(callback(self, *args))
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinxcontrib/versioning/sphinx_.py", line 92, in html_page_context
    banner_main_remote = versions[cls.BANNER_MAIN_VERSION] if cls.SHOW_BANNER else None
  File "/Users/robpol86/workspace/sphinxcontrib-versioning/.tox/docsV/lib/python3.5/site-packages/sphinxcontrib/versioning/versions.py", line 187, in __getitem__
    raise KeyError(item)
KeyError: 'v2.2.0'