1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8
9 # dependencies
10 pyperclip,
11 textual,
12
13 # tests
14 pytestCheckHook,
15 pytest-asyncio,
16 tree-sitter-python,
17 tree-sitter-sql,
18}:
19
20buildPythonPackage rec {
21 pname = "textual-textarea";
22 version = "0.15.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "tconbeer";
27 repo = "textual-textarea";
28 tag = "v${version}";
29 hash = "sha256-aaeXgD6RMQ3tlK5H/2lk3ueTyA3yYjHrYL51w/1tvSI=";
30 };
31
32 patches = [
33 # https://github.com/tconbeer/textual-textarea/issues/296
34 ./textual-2.0.0.diff
35 ];
36
37 pythonRelaxDeps = [
38 "textual"
39 ];
40
41 build-system = [ poetry-core ];
42
43 dependencies = [
44 pyperclip
45 textual
46 ]
47 ++ textual.optional-dependencies.syntax;
48
49 nativeCheckInputs = [
50 pytestCheckHook
51 pytest-asyncio
52 tree-sitter-python
53 tree-sitter-sql
54 ];
55
56 pythonImportsCheck = [ "textual_textarea" ];
57
58 disabledTests = [
59 # AssertionError: assert Selection(sta...), end=(0, 6)) == Selection(sta...), end=(1, 0))
60 # https://github.com/tconbeer/textual-textarea/issues/296
61 "test_keys"
62 ];
63
64 meta = {
65 description = "Text area (multi-line input) with syntax highlighting for Textual";
66 homepage = "https://github.com/tconbeer/textual-textarea";
67 changelog = "https://github.com/tconbeer/textual-textarea/releases/tag/v${version}";
68 license = lib.licenses.mit;
69 maintainers = with lib.maintainers; [ pcboy ];
70 };
71}