mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 12:35:49 +08:00
Update outdated upstream_repository fields (#15334)
This commit is contained in:
@@ -105,12 +105,18 @@ async def get_upstream_repo_url(project: str) -> str | None:
|
||||
# Remove `www.`; replace `http://` with `https://`
|
||||
url = re.sub(r"^(https?://)?(www\.)?", "https://", url_to_check)
|
||||
netloc = urllib.parse.urlparse(url).netloc
|
||||
if netloc in {"gitlab.com", "github.com", "bitbucket.org", "foss.heptapod.net"}:
|
||||
# truncate to https://site.com/user/repo
|
||||
upstream_repo_url = "/".join(url.split("/")[:5])
|
||||
async with session.get(upstream_repo_url) as response:
|
||||
if response.status == HTTPStatus.OK:
|
||||
return upstream_repo_url
|
||||
if netloc not in {"gitlab.com", "github.com", "bitbucket.org", "foss.heptapod.net"}:
|
||||
continue
|
||||
# truncate to https://site.com/user/repo
|
||||
upstream_repo_url = "/".join(url.split("/")[:5])
|
||||
async with session.get(upstream_repo_url, allow_redirects=True) as response:
|
||||
if response.status != HTTPStatus.OK:
|
||||
continue
|
||||
# final url after redirects
|
||||
final_url = str(response.url)
|
||||
# normalize again (in case redirect added extra path)
|
||||
final_repo_url = "/".join(final_url.split("/")[:5])
|
||||
return final_repo_url
|
||||
return None
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version = "1.6.6"
|
||||
upstream_repository = "https://github.com/lepture/authlib"
|
||||
upstream_repository = "https://github.com/authlib/authlib"
|
||||
requires = ["cryptography"]
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version = "~=1.3.1"
|
||||
upstream_repository = "https://github.com/tantale/deprecated"
|
||||
upstream_repository = "https://github.com/laurent-laporte-pro/deprecated"
|
||||
requires = []
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
version = "2.8.4"
|
||||
upstream_repository = "https://github.com/PyFPDF/fpdf2"
|
||||
upstream_repository = "https://github.com/py-pdf/fpdf2"
|
||||
requires = ["Pillow>=10.3.0"]
|
||||
|
||||
[tool.stubtest]
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
version = "1.3.*"
|
||||
upstream_repository = "https://github.com/drkjam/netaddr"
|
||||
upstream_repository = "https://github.com/netaddr/netaddr"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
version = "3.3.*"
|
||||
upstream_repository = "https://github.com/RedFantom/ttkthemes"
|
||||
upstream_repository = "https://github.com/TkinterEP/ttkthemes"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
version = "0.9.*"
|
||||
upstream_repository = "https://github.com/alexsdutton/www-authenticate"
|
||||
upstream_repository = "https://github.com/alexdutton/www-authenticate"
|
||||
|
||||
Reference in New Issue
Block a user