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