41
41
# Workaround for installing PyVISA on Windows from source:
42
42
os .environ ["HOME" ] = os .environ ["USERPROFILE" ]
43
43
44
- # pep503 defines normalized package names: www.python.org/dev/peps/pep-0503
45
- def normalize (name ):
46
- """return normalized (unique) name of a package"""
47
- return re .sub (r"[-_.]+" , "-" , name ).lower ()
48
-
49
-
50
44
51
45
class BasePackage (object ):
52
46
def __init__ (self , fname ):
53
47
self .fname = fname
54
48
self .name = None
55
49
self .version = None
56
- self .description = None
50
+ self .description = ""
57
51
self .url = None
58
52
59
53
def __str__ (self ):
@@ -71,8 +65,6 @@ def __init__(self, fname, update=False, suggested_summary=None):
71
65
if suggested_summary :
72
66
setattr (self , 'description' ,
73
67
piptree .sum_up (suggested_summary ))
74
- else :
75
- setattr (self , 'description' ,'.' )
76
68
bname = fname .split ("-" )[0 ]
77
69
setattr (self ,'url' ,"https://pypi.org/project/" + bname )
78
70
@@ -220,7 +212,7 @@ def get_installed_packages(self, update=False):
220
212
def find_package (self , name ):
221
213
"""Find installed package"""
222
214
for pack in self .get_installed_packages ():
223
- if normalize (pack .name ) == normalize (name ):
215
+ if utils . normalize (pack .name ) == utils . normalize (name ):
224
216
return pack
225
217
226
218
def patch_all_shebang (
@@ -553,9 +545,7 @@ def main(test=False):
553
545
# dist.uninstall(pack)
554
546
else :
555
547
registerWinPythonHelp = f"Register distribution: associate file extensions, icons and context menu with this WinPython"
556
-
557
548
unregisterWinPythonHelp = f"Unregister distribution: de-associate file extensions, icons and context menu from this WinPython"
558
-
559
549
parser = ArgumentParser (
560
550
description = "WinPython Package Manager: handle a WinPython Distribution and its packages" ,
561
551
formatter_class = RawTextHelpFormatter ,
0 commit comments