depot/third_party/nixpkgs/pkgs/development/python-modules/selenium/default.nix
Default email c594a97518 Project import generated by Copybara.
GitOrigin-RevId: 301aada7a64812853f2e2634a530ef5d34505048
2022-10-21 20:38:19 +02:00

56 lines
1.2 KiB
Nix

{ lib
, fetchFromGitHub
, buildPythonPackage
, geckodriver
, pytestCheckHook
, pythonOlder
, trio
, trio-websocket
, urllib3
, nixosTests
}:
buildPythonPackage rec {
pname = "selenium";
version = "4.5.0";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "SeleniumHQ";
repo = "selenium";
# check if there is a newer tag with or without -python suffix
rev = "refs/tags/selenium-${version}";
hash = "sha256-K90CQYTeX9GKpP0ahxLx2HO5HG0P6MN7jeWmHtfiOns=";
};
postPatch = ''
substituteInPlace py/selenium/webdriver/firefox/service.py \
--replace 'DEFAULT_EXECUTABLE_PATH = "geckodriver"' 'DEFAULT_EXECUTABLE_PATH = "${geckodriver}/bin/geckodriver"'
'';
preConfigure = ''
cd py
'';
propagatedBuildInputs = [
trio
trio-websocket
urllib3
] ++ urllib3.optional-dependencies.secure
++ urllib3.optional-dependencies.socks;
checkInputs = [
pytestCheckHook
];
passthru.tests = {
testing-vaultwarden = nixosTests.vaultwarden;
};
meta = with lib; {
description = "Bindings for Selenium WebDriver";
homepage = "https://selenium.dev/";
license = licenses.asl20;
maintainers = with maintainers; [ jraygauthier SuperSandro2000 ];
};
}