def _copy_dist_from_dir(link_path, location):
<EOL>if os.path.isdir(location):<EOL><INDENT>rmtree(location)<EOL><DEDENT>setup_py = '<STR_LIT>'<EOL>sdist_args = [sys.executable]<EOL>sdist_args.append('<STR_LIT:-c>')<EOL>sdist_args.append(SETUPTOOLS_SHIM % setup_py)<EOL>sdist_args.append('<STR_LIT>')<EOL>sdist_args += ['<STR_LIT>', location]<EOL>logger.info('<STR_LIT>', link_path)<EOL>with indent_log():<EOL><INDENT>call_subprocess(sdist_args, cwd=link_path, show_stdout=False)<EOL><DEDENT>sdist = os.path.join(location, os.listdir(location)[<NUM_LIT:0>])<EOL>logger.info('<STR_LIT>', sdist, location)<EOL>unpack_file(sdist, location, content_type=None, link=None)<EOL>
Copy distribution files in `link_path` to `location`.

    Invoked when user requests to install a local directory. E.g.:

        pip install .
        pip install ~/dev/git-repos/python-prompt-toolkit