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.12";
24 pyproject = true;
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchFromGitHub {
29 owner = "urwid";
30 repo = "urwid";
31 rev = "refs/tags/${version}";
32 hash = "sha256-JGX9v/x8c7ayHnxVjC7u4YLs3OvZmTzPNFUfqGCeIRQ=";
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 passthru.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 passthru.optional-dependencies);
66
67 env.LC_ALL = "en_US.UTF8";
68
69 pytestFlagsArray = [ "tests" ];
70
71 disabledTestPaths = [
72 # expect call hangs
73 "tests/test_vterm.py"
74 ];
75
76 pythonImportsCheck = [ "urwid" ];
77
78 meta = with lib; {
79 description = "A full-featured console (xterm et al.) user interface library";
80 changelog = "https://github.com/urwid/urwid/releases/tag/${version}";
81 downloadPage = "https://github.com/urwid/urwid";
82 homepage = "https://urwid.org/";
83 license = licenses.lgpl21Plus;
84 maintainers = with maintainers; [ ];
85 };
86}