# Path: version.py
# def get_version():
#     d = os.path.dirname(__file__)
# 
#     if os.path.isdir(os.path.join(d, '../../.git')):
#         # Get the version using "git describe".
#         version_git = call_git_describe()
# 
#         # PEP 386 compatibility
#         if version_git:
#             version = "%s-%s" % (
#                 '.post'.join(version_git.split('-')[:2]),
#                 '-'.join(version_git.split('-')[2:])
#             )
# 
#         print("Version number from GIT repository: {}".format(version))
#     else:
#         write_pkg_info()
#         # Extract the version from the PKG-INFO file.
#         with open(os.path.join(d, 'PKG-INFO')) as f:
#             version = version_re.search(f.read()).group(1)
#         print("Version number from PKG-INFO: {}".format(version))
# 
#     return version


import os
from setuptools import setup, find_packages
from version import get_version
"""Install siptools."""



def scripts_list():
    """Return list of command line tools from package pas.scripts."""
    scripts = []
    for modulename in os.listdir('siptools/scripts'):
        if modulename == '__init__.py':
            continue
        if not modulename.endswith('.py'):
            continue
        modulename = modulename.replace('.py', '')
        scriptname = modulename.replace('_', '-')
        scripts.append(
            '%s = siptools.scripts.%s:main' % (scriptname, modulename)
        )
    print(scripts)
    return scripts


def main():
    """Install siptools."""
    setup(
        name='siptools',
        packages=find_packages(exclude=['tests', 'tests.*']),
        include_package_data=True,

# Path: version.py
# def get_version():
#     d = os.path.dirname(__file__)
# 
#     if os.path.isdir(os.path.join(d, '../../.git')):
#         # Get the version using "git describe".
#         version_git = call_git_describe()
# 
#         # PEP 386 compatibility
#         if version_git:
#             version = "%s-%s" % (
#                 '.post'.join(version_git.split('-')[:2]),
#                 '-'.join(version_git.split('-')[2:])
#             )
# 
#         print("Version number from GIT repository: {}".format(version))
#     else:
#         write_pkg_info()
#         # Extract the version from the PKG-INFO file.
#         with open(os.path.join(d, 'PKG-INFO')) as f:
#             version = version_re.search(f.read()).group(1)
#         print("Version number from PKG-INFO: {}".format(version))
# 
#     return version


# Path: setup.py
import os
from setuptools import setup, find_packages
from version import get_version

"""Install siptools."""



def scripts_list():
    """Return list of command line tools from package pas.scripts."""
    scripts = []
    for modulename in os.listdir('siptools/scripts'):
        if modulename == '__init__.py':
            continue
        if not modulename.endswith('.py'):
            continue
        modulename = modulename.replace('.py', '')
        scriptname = modulename.replace('_', '-')
        scripts.append(
            '%s = siptools.scripts.%s:main' % (scriptname, modulename)
        )
    print(scripts)
    return scripts


def main():
    """Install siptools."""
    setup(
        name='siptools',
        packages=find_packages(exclude=['tests', 'tests.*']),
        include_package_data=True,

        version=get_version(),