Skip to content

Commit 5fead6a

Browse files
authored
Update outdated upstream_repository fields (#15334)
1 parent c3fa8a0 commit 5fead6a

7 files changed

Lines changed: 18 additions & 12 deletions

File tree

scripts/create_baseline_stubs.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,18 @@ async def get_upstream_repo_url(project: str) -> str | None:
105105
# Remove `www.`; replace `http://` with `https://`
106106
url = re.sub(r"^(https?://)?(www\.)?", "https://", url_to_check)
107107
netloc = urllib.parse.urlparse(url).netloc
108-
if netloc in {"gitlab.com", "github.com", "bitbucket.org", "foss.heptapod.net"}:
109-
# truncate to https://site.com/user/repo
110-
upstream_repo_url = "/".join(url.split("/")[:5])
111-
async with session.get(upstream_repo_url) as response:
112-
if response.status == HTTPStatus.OK:
113-
return upstream_repo_url
108+
if netloc not in {"gitlab.com", "github.com", "bitbucket.org", "foss.heptapod.net"}:
109+
continue
110+
# truncate to https://site.com/user/repo
111+
upstream_repo_url = "/".join(url.split("/")[:5])
112+
async with session.get(upstream_repo_url, allow_redirects=True) as response:
113+
if response.status != HTTPStatus.OK:
114+
continue
115+
# final url after redirects
116+
final_url = str(response.url)
117+
# normalize again (in case redirect added extra path)
118+
final_repo_url = "/".join(final_url.split("/")[:5])
119+
return final_repo_url
114120
return None
115121

116122

stubs/Authlib/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version = "1.6.6"
2-
upstream_repository = "https://github.com/lepture/authlib"
2+
upstream_repository = "https://github.com/authlib/authlib"
33
requires = ["cryptography"]

stubs/Deprecated/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version = "~=1.3.1"
2-
upstream_repository = "https://github.com/tantale/deprecated"
2+
upstream_repository = "https://github.com/laurent-laporte-pro/deprecated"
33
requires = []

stubs/fpdf2/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version = "2.8.4"
2-
upstream_repository = "https://github.com/PyFPDF/fpdf2"
2+
upstream_repository = "https://github.com/py-pdf/fpdf2"
33
requires = ["Pillow>=10.3.0"]
44

55
[tool.stubtest]

stubs/netaddr/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "1.3.*"
2-
upstream_repository = "https://github.com/drkjam/netaddr"
2+
upstream_repository = "https://github.com/netaddr/netaddr"

stubs/ttkthemes/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "3.3.*"
2-
upstream_repository = "https://github.com/RedFantom/ttkthemes"
2+
upstream_repository = "https://github.com/TkinterEP/ttkthemes"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "0.9.*"
2-
upstream_repository = "https://github.com/alexsdutton/www-authenticate"
2+
upstream_repository = "https://github.com/alexdutton/www-authenticate"

0 commit comments

Comments
 (0)