@@ -428,3 +428,30 @@ def test_uninstall_setuptools_develop_install(script, data):
428
428
) in uninstall2 .files_deleted , list (uninstall2 .files_deleted .keys ())
429
429
list_result2 = script .pip ('list' , '--format=legacy' )
430
430
assert "FSPkg" not in list_result2 .stdout
431
+
432
+
433
+ def test_uninstall_editable_and_pip_install (script , data ):
434
+ """Try uninstall after pip install -e after pip install"""
435
+ # SETUPTOOLS_SYS_PATH_TECHNIQUE=raw removes the assumption that `-e`
436
+ # installs are always higher priority than regular installs.
437
+ # This becomes the default behavior in setuptools 25.
438
+ script .environ ['SETUPTOOLS_SYS_PATH_TECHNIQUE' ] = 'raw'
439
+
440
+ pkg_path = data .packages .join ("FSPkg" )
441
+ script .pip ('install' , '-e' , '.' ,
442
+ expect_stderr = True , cwd = pkg_path )
443
+ # ensure both are installed with --ignore-installed:
444
+ script .pip ('install' , '--ignore-installed' , '.' ,
445
+ expect_stderr = True , cwd = pkg_path )
446
+ list_result = script .pip ('list' , '--format=legacy' )
447
+ assert "FSPkg (0.1.dev0, " in list_result .stdout
448
+ # Uninstall both develop and install
449
+ uninstall = script .pip ('uninstall' , 'FSPkg' , '-y' )
450
+ assert not any (filename .endswith ('.egg-link' )
451
+ for filename in uninstall .files_deleted .keys ())
452
+ uninstall2 = script .pip ('uninstall' , 'FSPkg' , '-y' )
453
+ assert join (
454
+ script .site_packages , 'FSPkg.egg-link'
455
+ ) in uninstall2 .files_deleted , list (uninstall2 .files_deleted .keys ())
456
+ list_result2 = script .pip ('list' , '--format=legacy' )
457
+ assert "FSPkg" not in list_result2 .stdout
0 commit comments