1{ stdenv
2, lib
3, buildPythonPackage
4, fetchFromGitHub
5, pytestCheckHook
6, matplotlib
7, python-snap7
8, opencv4
9}:
10
11buildPythonPackage rec {
12 pname = "remi";
13 version = "2022.7.27";
14
15 src = fetchFromGitHub {
16 owner = "rawpython";
17 repo = pname;
18 rev = version;
19 hash = "sha256-VQn+Uzp6oGSit8ot0e8B0C2N41Q8+J+o91skyVN1gDA=";
20 };
21
22 preCheck = ''
23 # for some reason, REMI already deal with these using try blocks, but they fail
24 substituteInPlace test/test_widget.py \
25 --replace \
26 "from html_validator import " \
27 "from .html_validator import "
28 substituteInPlace test/test_examples_app.py \
29 --replace \
30 "from mock_server_and_request import " \
31 "from .mock_server_and_request import " \
32 --replace \
33 "from html_validator import " \
34 "from .html_validator import "
35 # Halves number of warnings
36 substituteInPlace test/test_*.py \
37 --replace \
38 "self.assertEquals(" \
39 "self.assertEqual("
40 '';
41
42 nativeCheckInputs = [
43 pytestCheckHook
44 python-snap7
45 opencv4
46 matplotlib
47 ];
48
49 pythonImportsCheck = [
50 "remi"
51 "editor"
52 "editor.widgets"
53 ];
54
55 meta = with lib; {
56 description = "Pythonic, lightweight and websocket-based webui library";
57 homepage = "https://github.com/rawpython/remi";
58 license = with licenses; [ asl20 ];
59 maintainers = with maintainers; [ pbsds ];
60 };
61}