Created
November 4, 2015 17:45
-
-
Save mplanchard/c94d79d37be063759662 to your computer and use it in GitHub Desktop.
Pip Uninstall Entry Points
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if dist.has_metadata('entry_points.txt'): | |
config = configparser.SafeConfigParser() | |
config.readfp( | |
FakeFile(dist.get_metadata_lines('entry_points.txt')) | |
) | |
if config.has_section('console_scripts'): | |
for name, value in config.items('console_scripts'): | |
if dist_in_usersite(dist): | |
bin_dir = bin_user | |
else: | |
bin_dir = bin_py | |
paths_to_remove.add(os.path.join(bin_dir, name)) | |
if WINDOWS: | |
paths_to_remove.add( | |
os.path.join(bin_dir, name) + '.exe' | |
) | |
paths_to_remove.add( | |
os.path.join(bin_dir, name) + '.exe.manifest' | |
) | |
paths_to_remove.add( | |
os.path.join(bin_dir, name) + '-script.py' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment