diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-05-25 14:34:26 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-05-25 14:34:26 -0400 |
commit | 0618357b84caff552ddc4ff20c722c026f9757af (patch) | |
tree | a487dd59cf7173e54cece007f125249971f4a50c | |
parent | 9157911013532e081f9ec6e29e7a4c271438f8ab (diff) | |
download | sqlalchemy-0618357b84caff552ddc4ff20c722c026f9757af.tar.gz |
- work around RTD issue #1293, take one
-rw-r--r-- | doc/build/conf.py | 32 | ||||
-rw-r--r-- | doc/build/requirements.txt | 2 |
2 files changed, 33 insertions, 1 deletions
diff --git a/doc/build/conf.py b/doc/build/conf.py index cd8cd47e9..8530c1ef8 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.stdout) + 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. diff --git a/doc/build/requirements.txt b/doc/build/requirements.txt index 954f97a8b..d1eb23d0f 100644 --- a/doc/build/requirements.txt +++ b/doc/build/requirements.txt @@ -1,3 +1,3 @@ changelog>=0.3.4 sphinx-paramlinks>=0.2.2 -zzzeeksphinx>=1.0.16 +git+https://bitbucket.org/zzzeek/zzzeeksphinx.git@HEAD#egg=zzzeeksphinx |