"""
Python packaging file for setup tools.
"""

# isort: STDLIB
import os

# isort: THIRDPARTY
import setuptools


def local_file(name):
    """
    Function to obtain the relative path of a filename.
    """
    return os.path.relpath(os.path.join(os.path.dirname(__file__), name))


README = local_file("README.rst")

with open(local_file("src/stratis_cli/_version.py")) as o:
    exec(o.read())  # pylint: disable=exec-used

setuptools.setup(
    name="stratis-cli",
    version=__version__,  # pylint: disable=undefined-variable
    author="Anne Mulhern",
    author_email="amulhern@redhat.com",
    description="Stratis CLI",
    long_description=open(README, encoding="utf-8").read(),
    platforms=["Linux"],
    license="Apache 2.0",
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Environment :: Console",
        "Intended Audience :: Developers",
        "Intended Audience :: System Administrators",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Topic :: Software Development :: Libraries",
        "Topic :: System :: Filesystems",
        "Topic :: Systems Administration",
    ],
    install_requires=[
        "dbus-client-gen>=0.4",
        "dbus-python-client-gen>=0.7",
        "justbytes>=0.14",
        "python-dateutil",
        "semantic_version",
        "wcwidth",
    ],
    package_dir={"": "src"},
    packages=setuptools.find_packages("src"),
    scripts=["bin/stratis"],
)

@@ -282,43 +282,8 @@
 )%0A%0A%0A
-README = local_file(%22README.rst%22)%0A%0A
 with
@@ -386,16 +386,109 @@
 c-used%0A%0A
+with open(local_file(%22README.rst%22), encoding=%22utf-8%22) as o:%0A    long_description = o.read()%0A%0A
 setuptoo
@@ -707,45 +707,24 @@
 ion=
-open(README, encoding=%22utf-8%22).read()
+long_description
 ,%0A  

Use a context manager for opening the README