mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #1311 from mwilliamson/py3-symlinks
Fix: "pip install ." fails on Python 3.3 (with symlinks in local directory)
This commit is contained in:
commit
68eb2c4a1b
|
@ -359,7 +359,7 @@ def unpack_file_url(link, location):
|
||||||
# delete the location since shutil will create it again :(
|
# delete the location since shutil will create it again :(
|
||||||
if os.path.isdir(location):
|
if os.path.isdir(location):
|
||||||
rmtree(location)
|
rmtree(location)
|
||||||
shutil.copytree(source, location)
|
shutil.copytree(source, location, symlinks=True)
|
||||||
else:
|
else:
|
||||||
unpack_file(source, location, content_type, link)
|
unpack_file(source, location, content_type, link)
|
||||||
|
|
||||||
|
|
0
tests/data/packages/symlinks/doc/intro
Normal file
0
tests/data/packages/symlinks/doc/intro
Normal file
1
tests/data/packages/symlinks/docs
Symbolic link
1
tests/data/packages/symlinks/docs
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
doc
|
3
tests/data/packages/symlinks/setup.cfg
Normal file
3
tests/data/packages/symlinks/setup.cfg
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[egg_info]
|
||||||
|
tag_build = dev
|
||||||
|
tag_svn_revision = true
|
8
tests/data/packages/symlinks/setup.py
Normal file
8
tests/data/packages/symlinks/setup.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
version = '0.1'
|
||||||
|
|
||||||
|
setup(name='symlinks',
|
||||||
|
version=version,
|
||||||
|
packages=["symlinks"],
|
||||||
|
)
|
1
tests/data/packages/symlinks/symlinks/__init__.py
Normal file
1
tests/data/packages/symlinks/symlinks/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#
|
|
@ -208,6 +208,18 @@ def test_install_from_local_directory(script, data):
|
||||||
assert egg_info_folder in result.files_created, str(result)
|
assert egg_info_folder in result.files_created, str(result)
|
||||||
|
|
||||||
|
|
||||||
|
def test_install_from_local_directory_with_symlinks_to_directories(script, data):
|
||||||
|
"""
|
||||||
|
Test installing from a local directory containing symlinks to directories.
|
||||||
|
"""
|
||||||
|
to_install = data.packages.join("symlinks")
|
||||||
|
result = script.pip('install', to_install, expect_error=False)
|
||||||
|
pkg_folder = script.site_packages/'symlinks'
|
||||||
|
egg_info_folder = script.site_packages/'symlinks-0.1dev-py%s.egg-info' % pyversion
|
||||||
|
assert pkg_folder in result.files_created, str(result.stdout)
|
||||||
|
assert egg_info_folder in result.files_created, str(result)
|
||||||
|
|
||||||
|
|
||||||
def test_install_from_local_directory_with_no_setup_py(script, data):
|
def test_install_from_local_directory_with_no_setup_py(script, data):
|
||||||
"""
|
"""
|
||||||
Test installing from a local directory with no 'setup.py'.
|
Test installing from a local directory with no 'setup.py'.
|
||||||
|
|
|
@ -264,7 +264,7 @@ class Path(_base):
|
||||||
"""
|
"""
|
||||||
Copies a directory tree to another path.
|
Copies a directory tree to another path.
|
||||||
"""
|
"""
|
||||||
return shutil.copytree(self, to)
|
return shutil.copytree(self, to, symlinks=True)
|
||||||
|
|
||||||
def move(self, to):
|
def move(self, to):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue