2015-12-20 03:29:56 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2016-12-23 13:42:35 +00:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import subprocess
|
2015-12-20 03:29:56 +00:00
|
|
|
|
|
|
|
extensions = [
|
|
|
|
'sphinx.ext.autodoc',
|
2016-04-03 02:23:15 +00:00
|
|
|
'rst.linker',
|
2015-12-20 03:29:56 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# General information about the project.
|
2016-12-23 13:42:35 +00:00
|
|
|
|
|
|
|
root = os.path.join(os.path.dirname(__file__), '..')
|
|
|
|
setup_script = os.path.join(root, 'setup.py')
|
2016-12-23 13:47:03 +00:00
|
|
|
fields = ['--name', '--version', '--url', '--author']
|
|
|
|
dist_info_cmd = [sys.executable, setup_script] + fields
|
2016-12-23 13:42:35 +00:00
|
|
|
output_bytes = subprocess.check_output(dist_info_cmd, cwd=root)
|
2016-12-23 13:57:20 +00:00
|
|
|
project, version, url, author = output_bytes.decode('utf-8').strip().split('\n')
|
2016-12-23 13:42:35 +00:00
|
|
|
|
2016-12-23 13:47:03 +00:00
|
|
|
copyright = '2016 ' + author
|
2015-12-20 03:29:56 +00:00
|
|
|
|
|
|
|
# The full version, including alpha/beta/rc tags.
|
|
|
|
release = version
|
|
|
|
|
|
|
|
master_doc = 'index'
|
2016-04-03 02:23:15 +00:00
|
|
|
|
|
|
|
link_files = {
|
2016-11-04 13:49:30 +00:00
|
|
|
'../CHANGES.rst': dict(
|
2016-04-03 02:23:15 +00:00
|
|
|
using=dict(
|
|
|
|
GH='https://github.com',
|
|
|
|
project=project,
|
2016-12-23 13:44:55 +00:00
|
|
|
url=url,
|
2016-04-03 02:23:15 +00:00
|
|
|
),
|
|
|
|
replace=[
|
|
|
|
dict(
|
|
|
|
pattern=r"(Issue )?#(?P<issue>\d+)",
|
2016-12-23 13:44:55 +00:00
|
|
|
url='{url}/issues/{issue}',
|
2016-04-03 02:23:15 +00:00
|
|
|
),
|
|
|
|
dict(
|
|
|
|
pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n",
|
|
|
|
with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n",
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
}
|