Rely on jaraco.packaging for loading the package metadata from the package for Sphinx.
This commit is contained in:
parent
b9bcd86948
commit
908cf4ad0e
27
docs/conf.py
27
docs/conf.py
|
@ -1,46 +1,23 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
if 'check_output' not in dir(subprocess):
|
|
||||||
import subprocess32 as subprocess
|
|
||||||
|
|
||||||
extensions = [
|
extensions = [
|
||||||
'sphinx.ext.autodoc',
|
'sphinx.ext.autodoc',
|
||||||
|
'jaraco.packaging.sphinx',
|
||||||
'rst.linker',
|
'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'
|
master_doc = 'index'
|
||||||
|
|
||||||
link_files = {
|
link_files = {
|
||||||
'../CHANGES.rst': dict(
|
'../CHANGES.rst': dict(
|
||||||
using=dict(
|
using=dict(
|
||||||
GH='https://github.com',
|
GH='https://github.com',
|
||||||
project=project,
|
|
||||||
url=url,
|
|
||||||
),
|
),
|
||||||
replace=[
|
replace=[
|
||||||
dict(
|
dict(
|
||||||
pattern=r"(Issue )?#(?P<issue>\d+)",
|
pattern=r"(Issue )?#(?P<issue>\d+)",
|
||||||
url='{url}/issues/{issue}',
|
url='{package_url}/issues/{issue}',
|
||||||
),
|
),
|
||||||
dict(
|
dict(
|
||||||
pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n",
|
pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n",
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
.
|
.
|
||||||
sphinx
|
sphinx
|
||||||
rst.linker
|
jaraco.packaging>=3.2
|
||||||
|
rst.linker>=1.9
|
||||||
|
|
Loading…
Reference in New Issue
Block a user