"""Defines the package, tests, and dependencies."""

import os
from setuptools import setup, find_packages


def read_full_documentation(fname):
    """Get long documentation from the README.md."""
    return open(os.path.join(os.path.dirname(__file__), fname)).read()


requirements = []


setup(
    name="darglint",
    version="0.0.2",
    author="Terrence Reilly",
    author_email="terrencepreilly@gmail.com",
    description=("A utility for ensuring Google-style docstrings"
                 "stay up to date with the source code."),
    license="MIT",
    keywords="documentation linter development",
    url="http://github.com/terrencepreilly/darglint",
    packages=find_packages(exclude=('tests', 'docs')),
    long_description=read_full_documentation('README.md'),
    entry_points={
        'console_scripts': [
            'darglint = darglint.driver:main',
        ],
    },
    install_requires=requirements,
    setup_requires=requirements,
    tests_require=['pytest'] + requirements,
    python_requires='>=3.6',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Documentation',
        'Topic :: Software Development :: Quality Assurance',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3.6',
    ]
)

@@ -99,17 +99,44 @@
 packages
+, Command%0Aimport subprocess
 %0A
-
 %0A%0Adef re
@@ -311,16 +311,1176 @@
  = %5B%5D%0A%0A%0A
+class PreBuildCommand(Command):%0A    %22%22%22Converts README file.%22%22%22%0A%0A    description = 'Converts README.md to README.rst using pandoc.'%0A    user_options = %5B%5D%0A%0A    def initialize_options(self):%0A        self.cwd = None%0A%0A    def finalize_options(self):%0A        self.cwd = os.getcwd()%0A%0A    def run(self):%0A        assert os.getcwd() == self.cwd, 'We must be in the package root.'%0A        try:%0A            subprocess.run(%5B'pandoc', 'README.md', '-o', 'README.rst'%5D)%0A        except Exception:%0A            print('Pandoc must be installed to convert README.')%0A%0A%0Aclass CleanCommand(Command):%0A    %22%22%22Cleans the project.%0A%0A    - Remove the README.rst file.%0A    - Remove the dist directory.%0A    - Remove the build directory.%0A    %22%22%22%0A%0A    description = 'Clean the directory of build artifacts'%0A    user_options = %5B%5D%0A%0A    def initialize_options(self):%0A        self.cwd = None%0A%0A    def finalize_options(self):%0A        self.cwd = os.getcwd()%0A%0A    def run(self):%0A        assert os.getcwd() == self.cwd, 'We must be in the package root.'%0A        subprocess.run(%5B'rm', './README.rst'%5D)%0A        subprocess.run(%5B'rm', '-rf', './dist'%5D)%0A        subprocess.run(%5B'rm', '-rf', './build'%5D)%0A%0A%0A
 setup(%0A 
@@ -2535,16 +2535,107 @@
 : 3.6',%0A
-
     %5D
+,%0A    cmdclass=%7B%0A        'prebuild': PreBuildCommand,%0A        'clean': CleanCommand,%0A    %7D,
 %0A)%0A

Add scripts for release to prebuild, clean.