@pytest.mark.network
def test_debian_egg_name_workaround(script):
 result = script.pip('install', 'INITools==0.2', expect_error=True)
 egg_info = os.path.join(script.site_packages, ('INITools-0.2-py%s.egg-info' % pyversion))
 assert (egg_info in result.files_created), ("Couldn't find %s" % egg_info)
 mangled = os.path.join(script.site_packages, 'INITools-0.2.egg-info')
 assert (mangled not in result.files_created), ('Found unexpected %s' % mangled)
 full_egg_info = os.path.join(script.base_path, egg_info)
 assert os.path.isdir(full_egg_info)
 full_mangled = os.path.join(script.base_path, mangled)
 os.renames(full_egg_info, full_mangled)
 assert os.path.isdir(full_mangled)
 result2 = script.pip('uninstall', 'INITools', '-y')
 assert_all_changes(result, result2, [(script.venv / 'build'), 'cache'])

@ pytest . mark . network def test_debian_egg_name_workaround ( script ) : result = script . pip ( 'install' , 'INITools==0.2' , expect_error = True ) egg_info = os . path . join ( script . site_packages , ( 'INITools-0.2-py%s.egg-info' % pyversion ) ) assert ( egg_info in result . files_created ) , ( "Couldn't find %s" % egg_info ) mangled = os . path . join ( script . site_packages , 'INITools-0.2.egg-info' ) assert ( mangled not in result . files_created ) , ( 'Found unexpected %s' % mangled ) full_egg_info = os . path . join ( script . base_path , egg_info ) assert os . path . isdir ( full_egg_info ) full_mangled = os . path . join ( script . base_path , mangled ) os . renames ( full_egg_info , full_mangled ) assert os . path . isdir ( full_mangled ) result2 = script . pip ( 'uninstall' , 'INITools' , '-y' ) assert_all_changes ( result , result2 , [ ( script . venv / 'build' ) , 'cache' ] )
we can uninstall packages installed with the pyversion removed from the egg-info metadata directory name .