Skip to content

Regression: Docs no longer build with py27-sphinx since #2394 #2593

Closed
@zmwangx

Description

@zmwangx

Docs used to build just fine with Sphinx under Python 2.7. #2394 introduced an import mypy.git to mypy.version (which is imported by Sphinx's conf.py), and since mypy.git contains function annotations not supported by Python 2.7, trying to build the docs with py27-sphinx now causes an error:

$ make html
sphinx-build -b html -d build/doctrees   source build/html
Running Sphinx v1.5.1

Configuration error:
There is a syntax error in your configuration file: invalid syntax (git.py, line 10)
make: *** [html] Error 1

This unfortunately is causing some trouble for Homebrew (see Homebrew/homebrew-core#7143), since our sphinx-doc formula is py27 only at the moment.

We'll of course try to fix this on Homebrew's side, but maybe py27-sphinx compatibility could be restored? One solution I can think of is to add something like mypy/version_static.py with the plain old version declaration:

__version__ = '0.4.7-dev'

then import mypy.version_static in docs/source/conf.py instead. The downside is it needs to be bumped alongside version.py at the same time, and when building from a git tree, the commit hash won't be included in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions