From 7ee337c2c69be05fe6ee8201b8f6a7a1c00a203e Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Thu, 16 May 2024 12:57:37 -0400 Subject: [PATCH] docs: use 'pylons_sphinx_themes' via dist Avoid the faux submodule, with attendant scary noise and performance problems. --- docs/conf.py | 28 +++++++--------------------- setup.py | 2 ++ 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 23cbddf..4124b6b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,30 +12,12 @@ import sys, os import pkg_resources +import pylons_sphinx_themes # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. -# Add and use Pylons theme -if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers - from subprocess import call, Popen, PIPE - - p = Popen('which git', shell=True, stdout=PIPE) - git = p.stdout.read().strip() - cwd = os.getcwd() - _themes = os.path.join(cwd, '_themes') - - if not os.path.isdir(_themes): - call([git, 'clone', 'https://github.com/Pylons/pylons_sphinx_theme.git', - '_themes']) - else: - os.chdir(_themes) - call([git, 'checkout', 'master']) - call([git, 'pull']) - os.chdir(cwd) - - sys.path.append(os.path.abspath('_themes')) # General configuration # --------------------- @@ -102,11 +84,15 @@ # ----------------------- # Add and use Pylons theme -html_theme_path = ['_themes'] +html_theme_path = pylons_sphinx_themes.get_html_themes_path() html_theme = 'pylons' html_theme_options = dict( github_url='https://github.com/Pylons/hypatia', -# in_progress='true' + # On main branch and new branch still in + # pre-release status: true; else: false. +# in_progress='true', + # On branches previous to "latest": true; else: false. +# outdated='false', ) # The style sheet to use for HTML and HTML Help pages. A file of that name diff --git a/setup.py b/setup.py index 15954e9..3a7afe0 100644 --- a/setup.py +++ b/setup.py @@ -80,6 +80,8 @@ def errprint(x): docs_extras = [ 'Sphinx >= 3.0.0', # Force RTD to use >= 3.0.0 + 'docutils', + 'pylons-sphinx-themes >= 1.0.8', # Ethical Ads ]