Open contrun opened 1 year ago
Upstream copied
webdriver_prefs.json
intowebdriver/firefox/
SeleniumHQ/selenium@deceb80
/py/BUILD.bazel#L91-L95
That all wouldn't be a problem if upstream wouldn't be using a distro hostile build system like bazel.
Here's the hack I used to get it working
with import <nixpkgs> {};
let
webdriver_prefs_json = fetchurl {
url = "https://raw.githubusercontent.com/SeleniumHQ/selenium/trunk/third_party/js/selenium/webdriver.json";
sha256 = "sha256-lGrdKYpeI0bj1T0cvorXwz5JlBMFEfbYt5JovlC3o0w=";
};
myPython = python3.override {
packageOverrides = self: super: {
selenium = super.selenium.overrideAttrs (oldAttrs: rec {
postInstall = ''
cp ${webdriver_prefs_json} $out/lib/python3.10/site-packages/selenium/webdriver/firefox/webdriver_prefs.json
'';
});
};
};
in
pkgs.mkShell {
buildInputs = [
myPython.pkgs.pythonPackages.selenium
];
}
Describe the bug
Some files of selenium python module is not packaged.
webdriver_prefs.json
is one of they.Steps To Reproduce
Steps to reproduce the behavior:
nix shell --impure --expr 'with import <nixpkgs>{}; python3.withPackages (ps: [ ps.selenium ])' -c python -c 'from selenium import webdriver; webdriver.FirefoxProfile(".")'
producesdocker run -it --rm python bash
andpip install selenium && python -c 'from selenium import webdriver; webdriver.FirefoxProfile(".")'
. Moreover in this python containerfind / -name webdriver_prefs.json
showsWhile
ls "$(dirname "$(find / -name webdriver_prefs.json)")"
showsBut on nixos
ls /nix/store/g182hmqdw2bk7bynfpb2wm20nw9sdar5-python3-3.10.9-env/lib/python3.10/site-packages/selenium/webdriver/firefox
showsExpected behavior
I expected
nix shell --impure --expr 'with import <nixpkgs>{}; python3.withPackages (ps: [ ps.selenium ])' -c python -c 'from selenium import webdriver; webdriver.FirefoxProfile(".")'
works.Notify maintainers
@jraygauthier @SuperSandro2000
Additional Context
Upstream copied
webdriver_prefs.json
intowebdriver/firefox/
https://github.com/SeleniumHQ/selenium/blob/deceb80a74102eae1ffc56b83c4cf963ba3c0e39/py/BUILD.bazel#L91-L95Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.