#!/usr/bin/env python3
# -*- coding: utf-8 -*-
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

import sys

from setuptools.command.test import test as TestCommand

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

with open("HISTORY.rst") as history_file:
    history = history_file.read().replace(".. :changelog:", "")

requirements = []
test_requirements = ["pytest"]


class PyTest(TestCommand):
    user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]

    def initialize_options(self):
        TestCommand.initialize_options(self)
        self.pytest_args = []

    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = []
        self.test_suite = True

    def run_tests(self):
        # import here, cause outside the eggs aren't loaded
        import pytest

        errno = pytest.main(self.pytest_args)
        sys.exit(errno)


setup(
    name="homebrew",
    version="0.0.30",
    description="Homebrew wrapper",
    long_description=readme + "\n\n" + history,
    author="Iwan in 't Groen",
    author_email="iwanintgroen@gmail.com",
    url="https://github.com/igroen/homebrew",
    packages=["homebrew"],
    package_dir={"homebrew": "homebrew"},
    include_package_data=True,
    install_requires=requirements,
    license="ISCL",
    zip_safe=False,
    keywords="homebrew",
    classifiers=[
        "Development Status :: 2 - Pre-Alpha",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: ISC License (ISCL)",
        "Natural Language :: English",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
    ],
    test_suite="tests",
    tests_require=test_requirements,
    cmdclass={"test": PyTest},
    entry_points={"console_scripts": ["hb=homebrew.command_line:main"]},
)

@@ -1,51 +1,4 @@
-#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A
 try:

Remove shebang and encoding from setup.py