

def _create_test_package_with_srcdir(script, name='version_pkg', vcs='git'):
    script.scratch_path.join(name).mkdir()
    version_pkg_path = (script.scratch_path / name)
    subdir_path = version_pkg_path.join('subdir')
    subdir_path.mkdir()
    src_path = subdir_path.join('src')
    src_path.mkdir()
    pkg_path = src_path.join('pkg')
    pkg_path.mkdir()
    pkg_path.join('__init__.py').write('')
    subdir_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            package_dir={{'': 'src'}},\n        )\n    ".format(name=name)))
    return _vcs_add(script, version_pkg_path, vcs)

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