|
22 | 22 | from rich import print
|
23 | 23 | from bs4 import BeautifulSoup
|
24 | 24 |
|
| 25 | +maintainers_name_map = { |
| 26 | + "mbussonn": "Carreau", |
| 27 | +} |
| 28 | + |
25 | 29 |
|
26 | 30 | def get_packages(url):
|
27 | 31 | # Send a GET request to the webpage with a custom user agent
|
@@ -127,9 +131,9 @@ async def get_package_maintainers(package: str) -> list[str]:
|
127 | 131 | soup = BeautifulSoup(html, "html.parser")
|
128 | 132 | maintainers = soup.find_all("span", class_="sidebar-section__maintainer")
|
129 | 133 | if not maintainers:
|
130 |
| - return ["unknown (blocked by fastly?)"] |
131 |
| - return [a.text.strip() for a in maintainers] |
132 |
| - return ["unknown (status code: " + str(response.status_code) + ")"] |
| 134 | + return set(["unknown (blocked by fastly?)"]) |
| 135 | + return set(a.text.strip() for a in maintainers) |
| 136 | + return set(["unknown (status code: " + str(response.status_code) + ")"]) |
133 | 137 |
|
134 | 138 |
|
135 | 139 | async def main():
|
@@ -157,7 +161,7 @@ async def main():
|
157 | 161 | async with trio.open_nursery() as nursery:
|
158 | 162 | targets = []
|
159 | 163 | semaphore = trio.Semaphore(10) # Throttle to 10 concurrent requests
|
160 |
| - for org, repo in todo[:10]: |
| 164 | + for org, repo in todo: |
161 | 165 |
|
162 | 166 | async def _loc(targets, org, repo):
|
163 | 167 | async with semaphore: # Wait for semaphore to be available
|
@@ -188,7 +192,10 @@ async def _loc(targets, org, repo):
|
188 | 192 | )
|
189 | 193 |
|
190 | 194 | for maintainer in maintainers:
|
191 |
| - print(f" |{maintainer}") |
| 195 | + if maintainer in maintainers_name_map: |
| 196 | + print(f" @{maintainers_name_map[maintainer]} ({maintainer})") |
| 197 | + else: |
| 198 | + print(f" @{maintainer}") |
192 | 199 |
|
193 | 200 | print()
|
194 | 201 | print("repos with no Pypi package:")
|
|
0 commit comments