#!/usr/bin/env python3

"""Package Keysmith."""

import setuptools  # type: ignore

import keysmith


with open('README.rst') as readme_file:
    README = readme_file.read()

setuptools.setup(
    name=keysmith.__name__,
    version=keysmith.__version__,
    description=keysmith.__doc__,
    long_description=README,
    author='David Tucker',
    author_email='david@tucker.name',
    license='LGPLv2+',
    url='https://github.com/dmtucker/keysmith',
    python_requires='~=3.5',
    py_modules=[keysmith.__name__],
    entry_points={
        'console_scripts': [
            '{script_name}={module}:main'.format(
                script_name=keysmith.CONSOLE_SCRIPT,
                module=keysmith.__name__,
            ),
        ],
    },
    keywords='password generator keygen',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'License :: OSI Approved'
        ' :: GNU Lesser General Public License v2 or later (LGPLv2+)',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
    ],
)

@@ -46,132 +46,753 @@
 %22%22%0A%0A
-import setuptools  # type: ignore%0A%0Aimport keysmith%0A%0A%0Awith open('README.rst') as readme_file:%0A    README = readme_file.read()
+%0Aimport codecs%0Aimport os.path%0Aimport re%0A%0Aimport setuptools  # type: ignore%0A%0A%0Adef read(*parts):%0A    %22%22%22Read a file in this repository.%22%22%22%0A    here = os.path.abspath(os.path.dirname(__file__))%0A    with codecs.open(os.path.join(here, *parts), 'r') as file_:%0A        return file_.read()%0A%0A%0Adef find_version(*file_paths):%0A    %22%22%22%0A    Read the file in setup.py and parse the version with a regex.%0A%0A    https://packaging.python.org/guides/single-sourcing-package-version/%0A    %22%22%22%0A    version_file = read(*file_paths)%0A    version_match = re.search(r%22%5E__version__ = %5B'%5C%22%5D(%5B%5E'%5C%22%5D*)%5B'%5C%22%5D%22,%0A                              version_file, re.M)%0A    if version_match:%0A        return version_match.group(1)%0A    raise RuntimeError(%22Unable to find version string.%22)%0A
 %0A%0Ase
@@ -816,24 +816,25 @@
    name=
+'
 keysmith
 .__name_
@@ -821,33 +821,25 @@
 me='keysmith
-.__name__
+'
 ,%0A    versio
@@ -844,62 +844,90 @@
 ion=
-keysmith.__version__,%0A    description=keysmith.__doc__
+find_version('keysmith.py'),%0A    description='A Diceware-style Password Generator'
 ,%0A  
@@ -949,14 +949,26 @@
 ion=
-README
+read('README.rst')
 ,%0A  
@@ -1146,24 +1146,25 @@
 odules=%5B
+'
 keysmith
 .__name_
@@ -1155,25 +1155,17 @@
 keysmith
-.__name__
+'
 %5D,%0A    e
@@ -1177,25 +1177,16 @@
 points=%7B
-%0A        
 'console
@@ -1201,184 +1201,33 @@
 ': %5B
-%0A            '%7Bscript_name%7D=%7Bmodule%7D:main'.format(%0A                script_name=keysmith.CONSOLE_SCRIPT,%0A                module=keysmith.__name__,%0A            ),%0A        %5D,%0A    
+'keysmith=keysmith:main'%5D
 %7D,%0A 

Stop importing keysmith in setup.py