# Path: awslimitchecker/version.py
# def _get_version_info():
#     """
#     Returns the currently-installed awslimitchecker version, and a best-effort
#     attempt at finding the origin URL and commit/tag if installed from an
#     editable git clone.
# 
#     :returns: awslimitchecker version
#     :rtype: str
#     """
#     if os.environ.get('VERSIONCHECK_DEBUG', '') != 'true':
#         for lname in ['versionfinder', 'pip', 'git']:
#             l = logging.getLogger(lname)
#             l.setLevel(logging.CRITICAL)
#             l.propagate = True
#     try:
#         vinfo = find_version('awslimitchecker')
#         dirty = ''
#         if vinfo.git_is_dirty:
#             dirty = '*'
#         tag = vinfo.git_tag
#         if tag is not None:
#             tag += dirty
#         commit = vinfo.git_commit
#         if commit is not None:
#             if len(commit) > 7:
#                 commit = commit[:8]
#             commit += dirty
#         return AWSLimitCheckerVersion(
#             vinfo.version,
#             vinfo.url,
#             tag=tag,
#             commit=commit
#         )
#     except Exception:
#         logger.exception("Error checking installed version; this installation "
#                          "may not be in compliance with the AGPLv3 license:")
#     # fall back to returning just the hard-coded release information
#     return AWSLimitCheckerVersion(_VERSION, _PROJECT_URL)
# 
# _VERSION = '.'.join([str(x) for x in _VERSION_TUP])


import sys
import os
import re
import logging
import types
import sphinx.environment
    import sphinx_rtd_theme
from awslimitchecker.version import _get_version_info, _VERSION
from docutils.utils import get_source_line
from docutils.nodes import GenericNodeVisitor, inline, Text, literal
from sphinx.addnodes import pending_xref
# -*- coding: utf-8 -*-
#
# awslimitchecker documentation build configuration file, created by
# sphinx-quickstart on Sat Jun  6 16:12:56 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# to let sphinx find the actual source...
sys.path.insert(0, os.path.abspath("../.."))

# 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.insert(0, os.path.abspath('.'))

is_rtd = os.environ.get('READTHEDOCS', None) != 'True'
readthedocs_version = os.environ.get('READTHEDOCS_VERSION', '')

rtd_version = _get_version_info().version_str

if (readthedocs_version in ['stable', 'latest', 'master'] or
    re.match(r'^\d+\.\d+\.\d+', readthedocs_version)):
    # this is a tag or stable/latest/master; show the actual version

# Path: awslimitchecker/version.py
# def _get_version_info():
#     """
#     Returns the currently-installed awslimitchecker version, and a best-effort
#     attempt at finding the origin URL and commit/tag if installed from an
#     editable git clone.
# 
#     :returns: awslimitchecker version
#     :rtype: str
#     """
#     if os.environ.get('VERSIONCHECK_DEBUG', '') != 'true':
#         for lname in ['versionfinder', 'pip', 'git']:
#             l = logging.getLogger(lname)
#             l.setLevel(logging.CRITICAL)
#             l.propagate = True
#     try:
#         vinfo = find_version('awslimitchecker')
#         dirty = ''
#         if vinfo.git_is_dirty:
#             dirty = '*'
#         tag = vinfo.git_tag
#         if tag is not None:
#             tag += dirty
#         commit = vinfo.git_commit
#         if commit is not None:
#             if len(commit) > 7:
#                 commit = commit[:8]
#             commit += dirty
#         return AWSLimitCheckerVersion(
#             vinfo.version,
#             vinfo.url,
#             tag=tag,
#             commit=commit
#         )
#     except Exception:
#         logger.exception("Error checking installed version; this installation "
#                          "may not be in compliance with the AGPLv3 license:")
#     # fall back to returning just the hard-coded release information
#     return AWSLimitCheckerVersion(_VERSION, _PROJECT_URL)
# 
# _VERSION = '.'.join([str(x) for x in _VERSION_TUP])


# Path: docs/source/conf.py
import sys
import os
import re
import logging
import types
import sphinx.environment
    import sphinx_rtd_theme
from awslimitchecker.version import _get_version_info, _VERSION
from docutils.utils import get_source_line
from docutils.nodes import GenericNodeVisitor, inline, Text, literal
from sphinx.addnodes import pending_xref

# -*- coding: utf-8 -*-
#
# awslimitchecker documentation build configuration file, created by
# sphinx-quickstart on Sat Jun  6 16:12:56 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# to let sphinx find the actual source...
sys.path.insert(0, os.path.abspath("../.."))

# 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.insert(0, os.path.abspath('.'))

is_rtd = os.environ.get('READTHEDOCS', None) != 'True'
readthedocs_version = os.environ.get('READTHEDOCS_VERSION', '')

rtd_version = _get_version_info().version_str

if (readthedocs_version in ['stable', 'latest', 'master'] or
    re.match(r'^\d+\.\d+\.\d+', readthedocs_version)):
    # this is a tag or stable/latest/master; show the actual version

    rtd_version = _VERSION