@@ -727,45 +727,6 @@ def unpack_file_url(link, location, download_dir=None):
727
727
_copy_file (from_path , download_dir , content_type , link )
728
728
729
729
730
- def _copy_dist_from_dir (link_path , location ):
731
- """Copy distribution files in `link_path` to `location`.
732
-
733
- Invoked when user requests to install a local directory. E.g.:
734
-
735
- pip install .
736
- pip install ~/dev/git-repos/python-prompt-toolkit
737
-
738
- """
739
-
740
- # Note: This is currently VERY SLOW if you have a lot of data in the
741
- # directory, because it copies everything with `shutil.copytree`.
742
- # What it should really do is build an sdist and install that.
743
- # See https://github.com/pypa/pip/issues/2195
744
-
745
- if os .path .isdir (location ):
746
- rmtree (location )
747
-
748
- # build an sdist
749
- setup_py = 'setup.py'
750
- sdist_args = [sys .executable ]
751
- sdist_args .append ('-c' )
752
- sdist_args .append (
753
- "import setuptools, tokenize;__file__=%r;"
754
- "exec(compile(getattr(tokenize, 'open', open)(__file__).read()"
755
- ".replace('\\ r\\ n', '\\ n'), __file__, 'exec'))" % setup_py )
756
- sdist_args .append ('sdist' )
757
- sdist_args += ['--dist-dir' , location ]
758
- logger .info ('Running setup.py sdist for %s' , link_path )
759
-
760
- with indent_log ():
761
- call_subprocess (sdist_args , cwd = link_path , show_stdout = False )
762
-
763
- # unpack sdist into `location`
764
- sdist = os .path .join (location , os .listdir (location )[0 ])
765
- logger .info ('Unpacking sdist %s into %s' , sdist , location )
766
- unpack_file (sdist , location , content_type = None , link = None )
767
-
768
-
769
730
class PipXmlrpcTransport (xmlrpc_client .Transport ):
770
731
"""Provide a `xmlrpclib.Transport` implementation via a `PipSession`
771
732
object.
0 commit comments