pythonPackages.pywebview: 3.3.1 -> 3.4

also fix tests by adding pyqtwebengine
This commit is contained in:
Johannes Schleifenbaum 2021-03-11 10:22:24 +01:00
parent ddb1c81c07
commit 1b154aacb1
No known key found for this signature in database
GPG Key ID: 059093B1A278BCD0

@ -1,25 +1,53 @@
{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder
, importlib-resources, pytest, xvfb_run }:
{ lib
, buildPythonPackage
, fetchFromGitHub
, importlib-resources
, pyqtwebengine
, pytest
, pythonOlder
, qt5
, xvfb_run
}:
buildPythonPackage rec {
pname = "pywebview";
version = "3.3.1";
version = "3.4";
disabled = pythonOlder "3.5";
src = fetchFromGitHub {
owner = "r0x0r";
repo = "pywebview";
rev = version;
sha256 = "015z7n0hdgkzn0p7aw1xsv6lwc260p8q67jx0zyd1zghnwyj8k79";
sha256 = "sha256-3JHwtw8oReolEl4k8cdt7GCVGNkfWWJN6EnZYHxzDO8=";
};
propagatedBuildInputs = lib.optionals (pythonOlder "3.7") [ importlib-resources ];
nativeBuildInputs = [
qt5.wrapQtAppsHook
];
checkInputs = [ pytest xvfb_run ];
propagatedBuildInputs = [
pyqtwebengine
] ++ lib.optionals (pythonOlder "3.7") [ importlib-resources ];
checkInputs = [
pytest
xvfb_run
];
checkPhase = ''
# Cannot create directory /homeless-shelter/.... Error: FILE_ERROR_ACCESS_DENIED
export HOME=$TMPDIR
# QStandardPaths: XDG_RUNTIME_DIR not set
export XDG_RUNTIME_DIR=$HOME/xdg-runtime-dir
pushd tests
substituteInPlace run.sh \
--replace "PYTHONPATH=.." "PYTHONPATH=$PYTHONPATH" \
--replace "pywebviewtest test_js_api.py::test_concurrent ''${PYTEST_OPTIONS}" "# skip flaky test_js_api.py::test_concurrent"
patchShebangs run.sh
wrapQtApp run.sh
xvfb-run -s '-screen 0 800x600x24' ./run.sh
popd
'';