1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, importlib-metadata 5, jinja2 6, markdown-it-py 7, poetry-core 8, pytest-aiohttp 9, pytestCheckHook 10, pythonOlder 11, rich 12, syrupy 13, time-machine 14, tree-sitter 15, typing-extensions 16}: 17 18buildPythonPackage rec { 19 pname = "textual"; 20 version = "0.41.0"; 21 pyproject = true; 22 23 disabled = pythonOlder "3.7"; 24 25 src = fetchFromGitHub { 26 owner = "Textualize"; 27 repo = pname; 28 rev = "refs/tags/v${version}"; 29 hash = "sha256-K3JpAVkw6njUT2AGGLL3ACagPK0K6Ny4PvCsbmuNvTo="; 30 }; 31 32 nativeBuildInputs = [ 33 poetry-core 34 ]; 35 36 propagatedBuildInputs = [ 37 importlib-metadata 38 markdown-it-py 39 rich 40 typing-extensions 41 ] ++ markdown-it-py.optional-dependencies.plugins 42 ++ markdown-it-py.optional-dependencies.linkify; 43 44 passthru.optional-dependencies = { 45 syntax = [ 46 tree-sitter 47 # tree-sitter-languages 48 ]; 49 }; 50 51 nativeCheckInputs = [ 52 jinja2 53 pytest-aiohttp 54 pytestCheckHook 55 syrupy 56 time-machine 57 ] ++ passthru.optional-dependencies.syntax; 58 59 disabledTestPaths = [ 60 # snapshot tests require syrupy<4 61 "tests/snapshot_tests/test_snapshots.py" 62 ]; 63 64 disabledTests = [ 65 # Assertion issues 66 "test_textual_env_var" 67 "test_softbreak_split_links_rendered_correctly" 68 69 # requires tree-sitter-languages which is not packaged in nixpkgs 70 "test_register_language" 71 ]; 72 73 pythonImportsCheck = [ 74 "textual" 75 ]; 76 77 __darwinAllowLocalNetworking = true; 78 79 meta = with lib; { 80 description = "TUI framework for Python inspired by modern web development"; 81 homepage = "https://github.com/Textualize/textual"; 82 changelog = "https://github.com/Textualize/textual/releases/tag/v${version}"; 83 license = licenses.mit; 84 maintainers = with maintainers; [ joelkoen ]; 85 }; 86}