def getSetupArgs(extensions=_EXTENSIONS, readme='README.rst'):
    """
    Generate arguments for C{setuptools.setup()}

    @param extensions: C extension modules to maybe build. This argument is to
        be used for testing.
    @type extensions: C{list} of C{ConditionalExtension}

    @param readme: Path to the readme reStructuredText file. This argument is
        to be used for testing.
    @type readme: C{str}

    @return: The keyword arguments to be used by the setup method.
    @rtype: L{dict}
    """
    _checkPythonVersion()

    arguments = STATIC_PACKAGE_METADATA.copy()
    if readme:
        arguments.update(_longDescriptionArgsFromReadme(readme))

    # This is a workaround for distutils behavior; ext_modules isn't
    # actually used by our custom builder.  distutils deep-down checks
    # to see if there are any ext_modules defined before invoking
    # the build_ext command.  We need to trigger build_ext regardless
    # because it is the thing that does the conditional checks to see
    # if it should build any extensions.  The reason we have to delay
    # the conditional checks until then is that the compiler objects
    # are not yet set up when this code is executed.
    arguments["ext_modules"] = extensions
    # Use custome class to build the extensions.
    class my_build_ext(build_ext_twisted):
        conditionalExtensions = extensions
    command_classes = {
        'build_ext': my_build_ext,
    }

    if sys.version_info[0] >= 3:
        command_classes['build_py'] = BuildPy3

    requirements = [
        "zope.interface >= 4.4.2",
        "constantly >= 15.1",
        "incremental >= 16.10.1",
        "Automat >= 0.3.0",
        "hyperlink >= 17.1.1",
        "PyHamcrest >= 1.9.0",
        "attrs >= 17.4.0",
    ]

    arguments.update(dict(
        packages=find_packages("src"),
        use_incremental=True,
        setup_requires=["incremental >= 16.10.1"],
        install_requires=requirements,
        entry_points={
            'console_scripts': _CONSOLE_SCRIPTS
        },
        cmdclass=command_classes,
        include_package_data=True,
        exclude_package_data={
            "": ["*.c", "*.h", "*.pxi", "*.pyx", "build.bat"],
        },
        zip_safe=False,
        extras_require=_EXTRAS_REQUIRE,
        package_dir={"": "src"},
    ))

    return arguments

    Generate arguments for C{setuptools.setup()}

    @param extensions: C extension modules to maybe build. This argument is to
        be used for testing.
    @type extensions: C{list} of C{ConditionalExtension}

    @param readme: Path to the readme reStructuredText file. This argument is
        to be used for testing.
    @type readme: C{str}

    @return: The keyword arguments to be used by the setup method.
    @rtype: L{dict}
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/_setup.py