Use setuptools_scm
This commit is contained in:
13
docs/conf.py
13
docs/conf.py
@@ -1,18 +1,14 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
import alabaster
|
||||
from setuptools.config import read_configuration
|
||||
from pkg_resources import get_distribution
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.append(os.path.abspath('..'))
|
||||
|
||||
conf_dict = read_configuration('../setup.cfg')
|
||||
__version__ = conf_dict['metadata']['version']
|
||||
|
||||
# -- General configuration ----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
@@ -49,9 +45,10 @@ copyright = '2012-2019, Simon Conseil'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = re.match(r'\d+\.\d+', __version__).group()
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = __version__
|
||||
release = get_distribution('sigal').version
|
||||
# for example take major/minor
|
||||
version = '.'.join(release.split('.')[:2])
|
||||
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
Reference in New Issue
Block a user