diff options
Diffstat (limited to 'doc/build/conf.py')
| -rw-r--r-- | doc/build/conf.py | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/doc/build/conf.py b/doc/build/conf.py index 35204b1b9..fa9be2d25 100644 --- a/doc/build/conf.py +++ b/doc/build/conf.py @@ -13,6 +13,25 @@ import sys import os +import traceback + +def force_install_reqs(): + import logging + + log = logging.getLogger("pip") + handler = logging.StreamHandler(sys.stderr) + handler.setFormatter(logging.Formatter("[pip] %(message)s")) + log.addHandler(handler) + log.setLevel(logging.INFO) + + log.info("READTHEDOCS is set, force-installing requirements.txt") + + from pip.commands import install + req = os.path.join(os.path.dirname(__file__), "requirements.txt") + cmd = install.InstallCommand() + options, args = cmd.parse_args(["-v", "-U", "-r", req]) + cmd.run(options, args) + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -23,6 +42,19 @@ sys.path.insert(0, os.path.abspath('.')) import sqlalchemy +# attempt to force pip to definitely get the latest +# versions of libraries, see +# https://github.com/rtfd/readthedocs.org/issues/1293 +rtd = os.environ.get('READTHEDOCS', None) == 'True' +if rtd: + try: + force_install_reqs() + except: + traceback.print_exc() + + + + # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -106,9 +138,9 @@ copyright = u'2007-2015, the SQLAlchemy authors and contributors' # The short X.Y version. version = "1.0" # The full version, including alpha/beta/rc tags. -release = "1.0.0b4" +release = "1.0.6" -release_date = "March 29, 2015" +release_date = "June 25, 2015" site_base = os.environ.get("RTD_SITE_BASE", "http://www.sqlalchemy.org") site_adapter_template = "docs_adapter.mako" |
