diff options
Diffstat (limited to 'pkgs/development/python-modules/playwright')
-rw-r--r-- | pkgs/development/python-modules/playwright/default.nix | 5 | ||||
-rwxr-xr-x | pkgs/development/python-modules/playwright/update.sh | 12 |
2 files changed, 11 insertions, 6 deletions
diff --git a/pkgs/development/python-modules/playwright/default.nix b/pkgs/development/python-modules/playwright/default.nix index 35deda3f92b78..bdd7846c7623b 100644 --- a/pkgs/development/python-modules/playwright/default.nix +++ b/pkgs/development/python-modules/playwright/default.nix @@ -15,7 +15,8 @@ let in buildPythonPackage rec { pname = "playwright"; - version = "1.32.1"; + # run ./pkgs/development/python-modules/playwright/update.sh to update + version = "1.34.0"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -23,7 +24,7 @@ buildPythonPackage rec { owner = "microsoft"; repo = "playwright-python"; rev = "v${version}"; - hash = "sha256-rguobFaepTOL2duHRdFV5o2JSsBlYiA7rY3/RyHvoMc="; + hash = "sha256-GIxMVuSSJsRDsHDOPnJsDsTcghGYtIFpRS5u7HJd+zY="; }; patches = [ diff --git a/pkgs/development/python-modules/playwright/update.sh b/pkgs/development/python-modules/playwright/update.sh index 51dd8723c8515..464f9a3cba05c 100755 --- a/pkgs/development/python-modules/playwright/update.sh +++ b/pkgs/development/python-modules/playwright/update.sh @@ -1,8 +1,10 @@ #!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl gnused nix-prefetch common-updater-scripts +#!nix-shell -i bash -p curl gnused nix-prefetch common-updater-scripts node2nix set -euo pipefail root="$(dirname "$(readlink -f "$0")")" +driver_file="$root/../../web/playwright/driver.nix" +playwright_test="$root/../../web/playwright-test" version=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} -s https://api.github.com/repos/microsoft/playwright-python/releases/latest | jq -r '.tag_name | sub("^v"; "")') @@ -13,11 +15,11 @@ setup_py_url="https://github.com/microsoft/playwright-python/raw/v${version}/set driver_version=$(curl -Ls "$setup_py_url" | grep '^driver_version =' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') fetch_driver_arch() { - nix-prefetch-url "https://playwright.azureedge.net/builds/driver/playwright-${version}-${1}.zip" + nix-prefetch-url "https://playwright.azureedge.net/builds/driver/playwright-${driver_version}-${1}.zip" } replace_sha() { - sed -i "s|$1 = \".\{44,52\}\"|$1 = \"$2\"|" "$root/default.nix" + sed -i "s|$1 = \".\{44,52\}\"|$1 = \"$2\"|" "$driver_file" } # Replace SHAs for the driver downloads @@ -27,5 +29,7 @@ replace_sha "aarch64-linux" "$(fetch_driver_arch "linux-arm64")" replace_sha "aarch64-darwin" "$(fetch_driver_arch "mac-arm64")" # Update the version stamps -sed -i "s/driverVersion = \"[^\$]*\"/driverVersion = \"$driver_version\"/" "$root/default.nix" +sed -i "s/version =\s*\"[^\$]*\"/version = \"$driver_version\"/" "$driver_file" +sed -i "s/\"@playwright\/test\": \"[^\$]*\"/\"@playwright\/test\": \"$driver_version\"/" "$playwright_test/node-packages.json" +(cd "$playwright_test"; node2nix -i node-packages.json) update-source-version playwright "$version" --rev="v$version" |