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 |