Skip to content

Commit 96f78dd

Browse files
authored
chore: smart detection for a driver download url (microsoft#1038)
Since Nov 16, 2021, we have the following conventions: - Drivers published from tip-of-tree have an `-alpha` version and are stored at `/next` subfolder on Azure Storage. - Drivers auto-published for each commit of the release branch have a `-beta` version and are stored at `/next` subfolder on Azure Storage. - Drivers published due to a release might have `-rc` as part of the version, and are stored in root subfolder on Azure Storage. We no longer have driver versions that include "next" as part of the version. I kept it for backwards compatibility.
1 parent 4774b61 commit 96f78dd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,14 @@ def run(self) -> None:
112112
for arch in platform:
113113
zip_file = f"playwright-{driver_version}-{arch['zip_name']}.zip"
114114
if not os.path.exists("driver/" + zip_file):
115-
url = f"https://playwright.azureedge.net/builds/driver/next/{zip_file}"
115+
url = "https://playwright.azureedge.net/builds/driver/"
116+
if (
117+
"-alpha" in driver_version
118+
or "-beta" in driver_version
119+
or "-next" in driver_version
120+
):
121+
url = url + "next/"
122+
url = url + zip_file
116123
print(f"Fetching {url}")
117124
# Don't replace this with urllib - Python won't have certificates to do SSL on all platforms.
118125
subprocess.check_call(["curl", url, "-o", "driver/" + zip_file])

0 commit comments

Comments
 (0)