From 908cf4ad0e27813933ada7cc9f16ebce9ac0c6cc Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 30 Mar 2017 04:36:53 -0400 Subject: [PATCH] Rely on jaraco.packaging for loading the package metadata from the package for Sphinx. --- docs/conf.py | 27 ++------------------------- docs/requirements.txt | 3 ++- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index fc94797..0e11c82 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,46 +1,23 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import os -import sys -import subprocess -import datetime - -if 'check_output' not in dir(subprocess): - import subprocess32 as subprocess - extensions = [ 'sphinx.ext.autodoc', + 'jaraco.packaging.sphinx', 'rst.linker', ] -# General information about the project. - -root = os.path.join(os.path.dirname(__file__), '..') -setup_script = os.path.join(root, 'setup.py') -fields = ['--name', '--version', '--url', '--author'] -dist_info_cmd = [sys.executable, setup_script] + fields -output_bytes = subprocess.check_output(dist_info_cmd, cwd=root) -project, version, url, author = output_bytes.decode('utf-8').strip().split('\n') - -copyright = author - -# The full version, including alpha/beta/rc tags. -release = version - master_doc = 'index' link_files = { '../CHANGES.rst': dict( using=dict( GH='https://github.com', - project=project, - url=url, ), replace=[ dict( pattern=r"(Issue )?#(?P\d+)", - url='{url}/issues/{issue}', + url='{package_url}/issues/{issue}', ), dict( pattern=r"^(?m)((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n", diff --git a/docs/requirements.txt b/docs/requirements.txt index c11e755..e7b6a74 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,4 @@ . sphinx -rst.linker +jaraco.packaging>=3.2 +rst.linker>=1.9