playwright: 1.32.1 -> 1.34.3

This commit is contained in:
Konstantin Alekseev 2023-06-04 14:07:33 +03:00
parent 4792ee0b1a
commit 82f8be70cd
7 changed files with 38 additions and 29 deletions

View file

@ -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 = [

View file

@ -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"

View file

@ -2,7 +2,7 @@
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-14_x"}:
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs_14"}:
let
nodeEnv = import ./node-env.nix {

View file

@ -530,12 +530,15 @@ let
then
ln -s $out/lib/node_modules/.bin $out/bin
# Patch the shebang lines of all the executables
# Fixup all executables
ls $out/bin/* | while read i
do
file="$(readlink -f "$i")"
chmod u+rwx "$file"
patchShebangs "$file"
if isScript "$file"
then
sed -i 's/\r$//' "$file" # convert crlf to lf
fi
done
fi

View file

@ -1,3 +1,3 @@
[
{"@playwright/test": "1.31.1"}
{"@playwright/test": "1.34.3"}
]

View file

@ -4,13 +4,13 @@
let
sources = {
"@types/node-18.15.11" = {
"@types/node-20.2.5" = {
name = "_at_types_slash_node";
packageName = "@types/node";
version = "18.15.11";
version = "20.2.5";
src = fetchurl {
url = "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz";
sha512 = "E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==";
url = "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz";
sha512 = "JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==";
};
};
"fsevents-2.3.2" = {
@ -22,30 +22,30 @@ let
sha512 = "xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==";
};
};
"playwright-core-1.31.1" = {
"playwright-core-1.34.3" = {
name = "playwright-core";
packageName = "playwright-core";
version = "1.31.1";
version = "1.34.3";
src = fetchurl {
url = "https://registry.npmjs.org/playwright-core/-/playwright-core-1.31.1.tgz";
sha512 = "JTyX4kV3/LXsvpHkLzL2I36aCdml4zeE35x+G5aPc4bkLsiRiQshU5lWeVpHFAuC8xAcbI6FDcw/8z3q2xtJSQ==";
url = "https://registry.npmjs.org/playwright-core/-/playwright-core-1.34.3.tgz";
sha512 = "2pWd6G7OHKemc5x1r1rp8aQcpvDh7goMBZlJv6Co5vCNLVcQJdhxRL09SGaY6HcyHH9aT4tiynZabMofVasBYw==";
};
};
};
in
{
"@playwright/test-1.31.1" = nodeEnv.buildNodePackage {
"@playwright/test-1.34.3" = nodeEnv.buildNodePackage {
name = "_at_playwright_slash_test";
packageName = "@playwright/test";
version = "1.31.1";
version = "1.34.3";
src = fetchurl {
url = "https://registry.npmjs.org/@playwright/test/-/test-1.31.1.tgz";
sha512 = "IsytVZ+0QLDh1Hj83XatGp/GsI1CDJWbyDaBGbainsh0p2zC7F4toUocqowmjS6sQff2NGT3D9WbDj/3K2CJiA==";
url = "https://registry.npmjs.org/@playwright/test/-/test-1.34.3.tgz";
sha512 = "zPLef6w9P6T/iT6XDYG3mvGOqOyb6eHaV9XtkunYs0+OzxBtrPAAaHotc0X+PJ00WPPnLfFBTl7mf45Mn8DBmw==";
};
dependencies = [
sources."@types/node-18.15.11"
sources."@types/node-20.2.5"
sources."fsevents-2.3.2"
sources."playwright-core-1.31.1"
sources."playwright-core-1.34.3"
];
buildInputs = globalBuildInputs;
meta = {

View file

@ -29,15 +29,16 @@ let
in
{
pname = "playwright-driver";
version = "1.31.1";
# run ./pkgs/development/python-modules/playwright/update.sh to update
version = "1.34.3";
src = fetchurl {
url = "https://playwright.azureedge.net/builds/driver/${filename}";
sha256 = {
x86_64-linux = "1wg49kfs8fflmx8g01bkckbjkghhwy7c44akckjf7dp4lbh1z8fd";
aarch64-linux = "0f09a0cxqxihy8lmbjzii80jkpf3n5xlvhjpgdkwmrr3wh0nnixj";
x86_64-darwin = "1zd0dz8jazymcpa1im5yzxb7rwl6wn4xz19lpz83bnpd1njq01b3";
aarch64-darwin = "0hcn80zm9aki8hzsf1cljzcmi4iaw7fascs8ajj0qcwqkkm4jnw0";
x86_64-linux = "1xh05v3yqa8gkwayhl4nffgjcnlakpyyi17hwzh0wqzrbwwn0cs8";
aarch64-linux = "18jxbmhiqda5pzrv6b3n7xi14xg4zvlh6sn7hc3b3hckl77vl933";
x86_64-darwin = "0fy5nxbvp1kxplavj832gxiznjqpvl0ww869hsfj0h1fibhly7cy";
aarch64-darwin = "11msl4pnmr8cmlw32xq2qvfz3g3fy0azvq134a47c0fnpj2gd5zl";
}.${system} or throwSystem;
};