

def _create_test_package_with_subdirectory(script, subdirectory):
    script.scratch_path.join('version_pkg').mkdir()
    version_pkg_path = (script.scratch_path / 'version_pkg')
    version_pkg_path.join('version_pkg.py').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(name='version_pkg',\n          version='0.1',\n          packages=find_packages(),\n          py_modules=['version_pkg'],\n          entry_points=dict(console_scripts=['version_pkg=version_pkg:main']))\n        "))
    subdirectory_path = version_pkg_path.join(subdirectory)
    subdirectory_path.mkdir()
    subdirectory_path.join('version_subpkg.py').write(textwrap.dedent("\n                                def main():\n                                    print('0.1')\n                                "))
    subdirectory_path.join('setup.py').write(textwrap.dedent("\nfrom setuptools import setup, find_packages\nsetup(name='version_subpkg',\n      version='0.1',\n      packages=find_packages(),\n      py_modules=['version_subpkg'],\n      entry_points=dict(console_scripts=['version_pkg=version_subpkg:main']))\n        "))
    script.run('git', 'init', cwd=version_pkg_path)
    script.run('git', 'add', '.', cwd=version_pkg_path)
    script.run('git', 'commit', '-q', '--author', 'pip <pypa-dev@googlegroups.com>', '-am', 'initial version', cwd=version_pkg_path)
    return version_pkg_path

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