

def _create_test_package(script, name='version_pkg', vcs='git'):
    script.scratch_path.join(name).mkdir()
    version_pkg_path = (script.scratch_path / name)
    version_pkg_path.join(('%s.py' % name)).write(textwrap.dedent("\n        def main():\n            print('0.1')\n    "))
    version_pkg_path.join('setup.py').write(textwrap.dedent("\n        from setuptools import setup, find_packages\n        setup(\n            name='{name}',\n            version='0.1',\n            packages=find_packages(),\n            py_modules=['{name}'],\n            entry_points=dict(console_scripts=['{name}={name}:main'])\n        )\n    ".format(name=name)))
    return _vcs_add(script, version_pkg_path, vcs)

dataset/ETHPy150Open pypa/pip/tests/lib/__init__.py _create_test_package/original