mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
catch easy_installed script wrappers
This commit is contained in:
parent
f5e7e71cd0
commit
1d1d644306
15
pip.py
15
pip.py
|
@ -62,8 +62,13 @@ else:
|
|||
# FIXME doesn't account for venv linked to global site-packages
|
||||
if sys.platform == 'win32':
|
||||
lib_py = os.path.join(sys.prefix, 'Lib')
|
||||
bin_py = os.path.join(sys.prefix, 'Scripts')
|
||||
# buildout uses 'bin' on Windows too?
|
||||
if not os.path.exists(bin_py):
|
||||
bin_py = os.path.join(sys.prefix, 'bin')
|
||||
else:
|
||||
lib_py = os.path.join(sys.prefix, 'lib', 'python%s' % sys.version[:3])
|
||||
bin_py = os.path.join(sys.prefix, 'bin')
|
||||
|
||||
pypi_url = "http://pypi.python.org/simple"
|
||||
|
||||
|
@ -1755,6 +1760,14 @@ execfile(__file__)
|
|||
'easy-install.pth')
|
||||
paths_to_remove.add_pth(easy_install_pth, dist.location)
|
||||
|
||||
# get scripts from metadata FIXME there seems to be no way to
|
||||
# get info about installed scripts from a
|
||||
# develop-install. python setup.py develop --record in
|
||||
# install_editable seemingly ought to work, but does not
|
||||
if dist.has_metadata('scripts') and dist.metadata_isdir('scripts'):
|
||||
for script in dist.metadata_listdir('scripts'):
|
||||
paths_to_remove.add(os.path.join(bin_py, script))
|
||||
|
||||
paths_to_remove.remove(auto_confirm)
|
||||
paths_to_remove.commit()
|
||||
|
||||
|
@ -4238,6 +4251,8 @@ class UninstallPathSet(object):
|
|||
self._moved_paths = []
|
||||
|
||||
def add(self, path):
|
||||
if not os.path.exists(path):
|
||||
return
|
||||
stripped = strip_prefix(os.path.normcase(path), self.prefix)
|
||||
if stripped:
|
||||
self.paths.add(stripped)
|
||||
|
|
|
@ -13,13 +13,13 @@ Simple install and uninstall::
|
|||
>>> diff_states(result.files_before, result2.files_after, ignore=['build']).values()
|
||||
[{}, {}, {}]
|
||||
|
||||
Uninstall an easy_installed package::
|
||||
Uninstall an easy_installed package with scripts::
|
||||
|
||||
>>> reset_env()
|
||||
>>> env = get_env()
|
||||
>>> result = env.run(join(env.base_path, 'bin', 'easy_install'), 'INITools')
|
||||
>>> assert('INITools' in result.files_updated[easy_install_pth].bytes), result.files_after[easy-install_pth].bytes
|
||||
>>> result2 = run_pip('uninstall', 'INITools', '-y', expect_error=True)
|
||||
>>> result = env.run(join(env.base_path, 'bin', 'easy_install'), 'Markdown')
|
||||
>>> assert('Markdown' in result.files_updated[easy_install_pth].bytes), result.files_after[easy-install_pth].bytes
|
||||
>>> result2 = run_pip('uninstall', 'markdown', '-y', expect_error=True)
|
||||
>>> diff_states(result.files_before, result2.files_after, ignore=['build']).values()
|
||||
[{}, {}, {}]
|
||||
|
||||
|
|
Loading…
Reference in a new issue