# Path: version.py
# def get_version():
#     d = dirname(__file__)
# 
#     if isdir(join(d, '.git')):
#         # Get the version using "git describe".
#         cmd = 'git describe --tags --match [0-9]*'.split()
#         try:
#             version = check_output(cmd).decode().strip()
#         except CalledProcessError:
#             print('Unable to get version number from git tags')
#             exit(1)
# 
#         # PEP 386 compatibility
#         if '-' in version:
#             version = '.post'.join(version.split('-')[:2])
# 
#     else:
#         # Extract the version from the PKG-INFO file.
#         import codecs
#         with codecs.open(join(d, 'PKG-INFO'), 'r', 'utf-8') as f:
#             version = version_re.search(f.read()).group(1)
# 
#     return version


import sys
import os
    import sphinx_rtd_theme
from version import get_version

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Riak Python Client'
copyright = u'2010-2014, Basho Technologies'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The full version, including alpha/beta/rc tags.

# Path: version.py
# def get_version():
#     d = dirname(__file__)
# 
#     if isdir(join(d, '.git')):
#         # Get the version using "git describe".
#         cmd = 'git describe --tags --match [0-9]*'.split()
#         try:
#             version = check_output(cmd).decode().strip()
#         except CalledProcessError:
#             print('Unable to get version number from git tags')
#             exit(1)
# 
#         # PEP 386 compatibility
#         if '-' in version:
#             version = '.post'.join(version.split('-')[:2])
# 
#     else:
#         # Extract the version from the PKG-INFO file.
#         import codecs
#         with codecs.open(join(d, 'PKG-INFO'), 'r', 'utf-8') as f:
#             version = version_re.search(f.read()).group(1)
# 
#     return version


# Path: docsrc/conf.py
import sys
import os
    import sphinx_rtd_theme
from version import get_version


# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Riak Python Client'
copyright = u'2010-2014, Basho Technologies'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The full version, including alpha/beta/rc tags.

release = get_version()