import re


def _setup_py_contains_pykern(setup_py):
    """Parses setup.py to see if it imports pykern

    This is hacky, but good enough because pykern and
    pksetup are unique names. If someone comments out with
    a multiline string, it's not super dangerous.

    Args:
        setup_py (py.path): setup.py file name

    Returns:
        bool: True if setup.py imports pykern and pksetup
    """
    with open(str(setup_py)) as f:
        return bool(
            re.search(
                r'^\s*(from|import)\s+pykern\b.*\bpksetup\b',
                f.read(),
                flags=re.MULTILINE,
            ),
        )