1{
2 lib,
3 buildPythonPackage,
4 exceptiongroup,
5 fetchFromGitHub,
6 glibcLocales,
7 pygobject3,
8 pyserial,
9 pytestCheckHook,
10 pythonOlder,
11 pyzmq,
12 setuptools,
13 setuptools-scm,
14 tornado,
15 trio,
16 twisted,
17 typing-extensions,
18 wcwidth,
19}:
20
21buildPythonPackage rec {
22 pname = "urwid";
23 version = "2.6.16";
24 pyproject = true;
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchFromGitHub {
29 owner = "urwid";
30 repo = "urwid";
31 tag = version;
32 hash = "sha256-D5NHtU7XQRh8OqkwrN5r8U/VGF87LGwdnaqGhdjN8AE=";
33 };
34
35 postPatch = ''
36 sed -i '/addopts =/d' pyproject.toml
37 '';
38
39 build-system = [
40 setuptools
41 setuptools-scm
42 ];
43
44 dependencies = [
45 typing-extensions
46 wcwidth
47 ];
48
49 optional-dependencies = {
50 glib = [ pygobject3 ];
51 tornado = [ tornado ];
52 trio = [
53 exceptiongroup
54 trio
55 ];
56 twisted = [ twisted ];
57 zmq = [ pyzmq ];
58 serial = [ pyserial ];
59 lcd = [ pyserial ];
60 };
61
62 nativeCheckInputs = [
63 glibcLocales
64 pytestCheckHook
65 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
66
67 env.LC_ALL = "en_US.UTF8";
68
69 pytestFlagsArray = [ "tests" ];
70
71 disabledTests = [
72 # Flaky tests
73 "TwistedEventLoopTest"
74 ];
75
76 disabledTestPaths = [
77 # expect call hangs
78 "tests/test_vterm.py"
79 ];
80
81 pythonImportsCheck = [ "urwid" ];
82
83 meta = with lib; {
84 description = "Full-featured console (xterm et al.) user interface library";
85 changelog = "https://github.com/urwid/urwid/releases/tag/${version}";
86 downloadPage = "https://github.com/urwid/urwid";
87 homepage = "https://urwid.org/";
88 license = licenses.lgpl21Plus;
89 maintainers = [ ];
90 };
91}