# Path: tupa/__version__.py
# VERSION = "1.4.2"


import os
import sys
    import pypandoc
from subprocess import run
from setuptools import setup, find_packages
from setuptools.command.install import install as _install
from tupa.__version__ import VERSION
except NameError:
    this_file = sys.argv[0]
os.chdir(os.path.dirname(os.path.abspath(this_file)))

with open("requirements.txt") as f:
    install_requires = f.read().splitlines()

try:
    # noinspection PyPackageRequirements
    try:
        pypandoc.convert_file("README.md", "rst", outputfile="README.rst")
    except (IOError, ImportError, RuntimeError):
        pass
    long_description = pypandoc.convert_file("README.md", "rst")
except (IOError, ImportError, RuntimeError):
    long_description = ""


class install(_install):
    # noinspection PyBroadException
    def run(self):
        # Install requirements
        self.announce("Installing dependencies...")
        run(["pip", "--no-cache-dir", "install"] + install_requires, check=True)

        # Install actual package
        _install.run(self)


setup(name="TUPA",

# Path: tupa/__version__.py
# VERSION = "1.4.2"


# Path: setup.py
import os
import sys
    import pypandoc
from subprocess import run
from setuptools import setup, find_packages
from setuptools.command.install import install as _install
from tupa.__version__ import VERSION

except NameError:
    this_file = sys.argv[0]
os.chdir(os.path.dirname(os.path.abspath(this_file)))

with open("requirements.txt") as f:
    install_requires = f.read().splitlines()

try:
    # noinspection PyPackageRequirements
    try:
        pypandoc.convert_file("README.md", "rst", outputfile="README.rst")
    except (IOError, ImportError, RuntimeError):
        pass
    long_description = pypandoc.convert_file("README.md", "rst")
except (IOError, ImportError, RuntimeError):
    long_description = ""


class install(_install):
    # noinspection PyBroadException
    def run(self):
        # Install requirements
        self.announce("Installing dependencies...")
        run(["pip", "--no-cache-dir", "install"] + install_requires, check=True)

        # Install actual package
        _install.run(self)


setup(name="TUPA",

      version=VERSION,