diff options
Diffstat (limited to 'docs/conf.py')
-rw-r--r-- | docs/conf.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/docs/conf.py b/docs/conf.py index 2b17634..2d86231 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,7 +1,9 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import pkg_resources +import os +import sys +import subprocess extensions = [ 'sphinx.ext.autodoc', @@ -9,11 +11,16 @@ extensions = [ ] # General information about the project. -project = 'pytest-runner' -copyright = '2015,2016 Jason R. Coombs' -# The short X.Y version. -version = pkg_resources.require(project)[0].version +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 = '2015-2017 ' + author + # The full version, including alpha/beta/rc tags. release = version @@ -24,11 +31,12 @@ link_files = { using=dict( GH='https://github.com', project=project, + url=url, ), replace=[ dict( pattern=r"(Issue )?#(?P<issue>\d+)", - url='{GH}/pytest-dev/{project}/issues/{issue}', + url='{url}/issues/{issue}', ), dict( pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n", |