#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    Setup file for lupin.

    This file was generated with PyScaffold 2.5.8, a tool that easily
    puts up a scaffold for your new Python project. Learn more under:
    http://pyscaffold.readthedocs.org/
"""

import sys
from setuptools import setup


try:
    import pypandoc
    long_description = pypandoc.convert("README.md", "rst")
    with open("README.rst", "w") as f:
        f.write(long_description)
except (ImportError, OSError):
    with open("README.md") as f:
        long_description = f.read()


def setup_package():
    needs_sphinx = {"build_sphinx", "upload_docs"}.intersection(sys.argv)
    sphinx = ["sphinx"] if needs_sphinx else []
    setup(setup_requires=["six", "pyscaffold>=2.5a0,<2.6a0"] + sphinx,
          use_pyscaffold=True,
          long_description=long_description)


if __name__ == "__main__":
    setup_package()
