ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / pywebview / default.nix
blobb80c85d8e13b5d651999e3827d59dd828b5a1306
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , importlib-resources
5 , proxy_tools
6 , pygobject3
7 , pyqtwebengine
8 , pytest
9 , pythonOlder
10 , qt5
11 , qtpy
12 , six
13 , xvfb-run
16 buildPythonPackage rec {
17   pname = "pywebview";
18   version = "3.7";
19   format = "setuptools";
21   disabled = pythonOlder "3.5";
23   src = fetchFromGitHub {
24     owner = "r0x0r";
25     repo = "pywebview";
26     rev = "refs/tags/${version}";
27     hash = "sha256-RRq6b0hqAzig/WwFK0VsrhHO6ar8HhMdAEIosPPNUQg=";
28   };
30   nativeBuildInputs = [
31     qt5.wrapQtAppsHook
32   ];
34   propagatedBuildInputs = [
35     pyqtwebengine
36     proxy_tools
37     six
38   ] ++ lib.optionals (pythonOlder "3.7") [
39     importlib-resources
40   ];
42   checkInputs = [
43     pygobject3
44     pytest
45     qtpy
46     xvfb-run
47   ];
49   checkPhase = ''
50     # Cannot create directory /homeless-shelter/.... Error: FILE_ERROR_ACCESS_DENIED
51     export HOME=$TMPDIR
52     # QStandardPaths: XDG_RUNTIME_DIR not set
53     export XDG_RUNTIME_DIR=$HOME/xdg-runtime-dir
55     pushd tests
56     substituteInPlace run.sh \
57       --replace "PYTHONPATH=.." "PYTHONPATH=$PYTHONPATH" \
58       --replace "pywebviewtest test_js_api.py::test_concurrent ''${PYTEST_OPTIONS}" "# skip flaky test_js_api.py::test_concurrent"
60     patchShebangs run.sh
61     wrapQtApp run.sh
63     xvfb-run -s '-screen 0 800x600x24' ./run.sh
64     popd
65   '';
67   pythonImportsCheck = [
68     "webview"
69   ];
71   meta = with lib; {
72     description = "Lightweight cross-platform wrapper around a webview";
73     homepage = "https://github.com/r0x0r/pywebview";
74     license = licenses.bsd3;
75     maintainers = with maintainers; [ jojosch ];
76   };