Skip to content

Commit f4a75ad

Browse files
committed
mapping
1 parent ed5e6e2 commit f4a75ad

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tools/all_repos.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
from rich import print
2323
from bs4 import BeautifulSoup
2424

25+
maintainers_name_map = {
26+
"mbussonn": "Carreau",
27+
}
28+
2529

2630
def get_packages(url):
2731
# 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]:
127131
soup = BeautifulSoup(html, "html.parser")
128132
maintainers = soup.find_all("span", class_="sidebar-section__maintainer")
129133
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) + ")"])
133137

134138

135139
async def main():
@@ -157,7 +161,7 @@ async def main():
157161
async with trio.open_nursery() as nursery:
158162
targets = []
159163
semaphore = trio.Semaphore(10) # Throttle to 10 concurrent requests
160-
for org, repo in todo[:10]:
164+
for org, repo in todo:
161165

162166
async def _loc(targets, org, repo):
163167
async with semaphore: # Wait for semaphore to be available
@@ -188,7 +192,10 @@ async def _loc(targets, org, repo):
188192
)
189193

190194
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}")
192199

193200
print()
194201
print("repos with no Pypi package:")

0 commit comments

Comments
 (0)