summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-04-02 22:23:15 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-04-02 22:23:15 -0400
commit01e953bac9ac132fba90550492ee9f7eedfce7e0 (patch)
tree5e491f09b1d79fc15e63b301c8615fb611ab175c
parent58f71d1e2bad2392cde6cfabef4fc9cfc8bfec28 (diff)
downloadpytest-runner-01e953bac9ac132fba90550492ee9f7eedfce7e0.tar.gz
Add support for linking to issues and adding datestamps to changelog entries.
-rw-r--r--docs/conf.py20
-rw-r--r--docs/history.rst2
-rw-r--r--setup.py2
3 files changed, 22 insertions, 2 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 1874074..9c7ad1b 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -5,6 +5,7 @@ import setuptools_scm
extensions = [
'sphinx.ext.autodoc',
+ 'rst.linker',
]
# General information about the project.
@@ -17,3 +18,22 @@ version = setuptools_scm.get_version(root='..', relative_to=__file__)
release = version
master_doc = 'index'
+
+link_files = {
+ 'CHANGES.rst': dict(
+ using=dict(
+ GH='https://github.com',
+ project=project,
+ ),
+ replace=[
+ dict(
+ pattern=r"(Issue )?#(?P<issue>\d+)",
+ url='{GH}/jaraco/{project}/issues/{issue}',
+ ),
+ dict(
+ pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n",
+ with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n",
+ ),
+ ],
+ ),
+}
diff --git a/docs/history.rst b/docs/history.rst
index 907000b..8e21750 100644
--- a/docs/history.rst
+++ b/docs/history.rst
@@ -5,4 +5,4 @@
History
*******
-.. include:: ../CHANGES.rst
+.. include:: ../CHANGES (links).rst
diff --git a/setup.py b/setup.py
index e825a5d..99d6c9c 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ with io.open('README.rst', encoding='utf-8') as readme:
needs_pytest = {'pytest', 'test'}.intersection(sys.argv)
pytest_runner = ['pytest_runner'] if needs_pytest else []
needs_sphinx = {'release', 'build_sphinx', 'upload_docs'}.intersection(sys.argv)
-sphinx = ['sphinx'] if needs_sphinx else []
+sphinx = ['sphinx', 'rst.linker'] if needs_sphinx else []
needs_wheel = {'release', 'bdist_wheel'}.intersection(sys.argv)
wheel = ['wheel'] if needs_wheel else []