src/eric7/PipInterface/piplicenses.py

branch
eric7
changeset 10179
c2125fcab4b8
parent 10027
63728909f3ff
child 10331
c1a2ff7e3575
equal deleted inserted replaced
10178:d13545cfafa1 10179:c2125fcab4b8
64 from email.message import Message 64 from email.message import Message
65 from typing import Callable, Dict, Iterator, Optional, Sequence 65 from typing import Callable, Dict, Iterator, Optional, Sequence
66 66
67 67
68 __pkgname__ = "pip-licenses" 68 __pkgname__ = "pip-licenses"
69 __version__ = "4.3.1" 69 __version__ = "4.3.2"
70 __author__ = "raimon" 70 __author__ = "raimon"
71 __license__ = "MIT" 71 __license__ = "MIT"
72 __summary__ = ( 72 __summary__ = (
73 "Dump the software license list of Python packages installed with pip." 73 "Dump the software license list of Python packages installed with pip."
74 ) 74 )
128 128
129 candidates: Dict[str, str] = {} 129 candidates: Dict[str, str] = {}
130 130
131 for entry in metadata.get_all("Project-URL", []): 131 for entry in metadata.get_all("Project-URL", []):
132 key, value = entry.split(",", 1) 132 key, value = entry.split(",", 1)
133 candidates[key.strip()] = value.strip() 133 candidates[key.strip().lower()] = value.strip()
134 134
135 for priority_key in ["Homepage", "Source", "Changelog", "Bug Tracker"]: 135 for priority_key in [ "homepage",
136 "source",
137 "repository",
138 "changelog",
139 "bug tracker",
140 ]:
136 if priority_key in candidates: 141 if priority_key in candidates:
137 return candidates[priority_key] 142 return candidates[priority_key]
138 143
139 return None 144 return None
140 145

eric ide

mercurial