summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-03-30 20:58:57 -0400
committerJason R. Coombs <jaraco@jaraco.com>2017-03-30 20:58:57 -0400
commitad44d51534f7e1dcef69e7b7aa80d7f4dc3247c5 (patch)
tree5c362b8bd300ce29c8c571360c4b4213b8fe4d92 /docs
parent6212aa4d93876285d04042914ab755271cd3737a (diff)
downloadcherrypy-git-ad44d51534f7e1dcef69e7b7aa80d7f4dc3247c5.tar.gz
Use rst.linker 1.9 and jaraco.packaging.sphinx to load details from project metadata.
Diffstat (limited to 'docs')
-rw-r--r--docs/conf.py28
1 files changed, 3 insertions, 25 deletions
diff --git a/docs/conf.py b/docs/conf.py
index abed3784..5cf38335 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -14,10 +14,7 @@
# serve to show the default.
import sys
-import os
-import datetime
import importlib
-import subprocess
assert sys.version_info > (3,), 'Python 3 required to build docs'
@@ -47,6 +44,7 @@ extensions = [
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'rst.linker',
+ 'jaraco.packaging.sphinx',
]
intersphinx_mapping = {
@@ -65,24 +63,6 @@ source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
-# load metadata from the project (borrowed from jaraco/skeleton)
-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')
-
-# General information about the project.
-copyright = '2001-%d %s' % (datetime.date.today().year, author)
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The full version, including alpha/beta/rc tags.
-release = version
-
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None # noqa
@@ -277,14 +257,12 @@ mock_pywin32() # noqa: E305
link_files = {
'../CHANGES.rst': dict(
using=dict(
- GH='https://github.com/cherrypy/{project}'.format(project=project),
- project=project,
- url=url,
+ GH='https://github.com',
),
replace=[
dict(
pattern=r'((Issue|PR)\s?)?#(?P<issue_or_pr>\d+)',
- url='{GH}/issues/{issue_or_pr}',
+ url='{GH}/cherrypy/{project}/issues/{issue_or_pr}',
),
dict(
pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',