python312Packages.textual: 1.0.0 -> 2.1.2 (#382551)

authored by Gaétan Lepage and committed by GitHub 00c9fc3d 5b72f061

+124 -49
+26 -9
pkgs/development/python-modules/pytest-textual-snapshot/default.nix
··· 2 2 lib, 3 3 buildPythonPackage, 4 4 fetchFromGitHub, 5 + 6 + # build-system 5 7 poetry-core, 8 + 9 + # dependencies 6 10 jinja2, 7 11 pytest, 8 12 rich, 9 - pythonOlder, 10 13 syrupy, 11 14 textual, 12 15 }: ··· 16 19 version = "1.1.0"; 17 20 pyproject = true; 18 21 19 - disabled = pythonOlder "3.8"; 20 - 21 22 src = fetchFromGitHub { 22 23 owner = "Textualize"; 23 24 repo = "pytest-textual-snapshot"; ··· 25 26 hash = "sha256-ItwwaODnlya/T0Fk5DOPRLoBOwkUN5wq69cELuvy/Js="; 26 27 }; 27 28 28 - nativeBuildInputs = [ poetry-core ]; 29 + # The script looks for `resources/snapshot_report_template.jinja2` in the parent folder which 30 + # is lib/python3.X/site-packages 31 + # Let's avoid to have a random 'resources' folder in the PYTHONPATH. 32 + # Instead, we move this `resources` folder in `$out/share` (see postInstall below) and patch the 33 + # path in the script. 34 + postPatch = '' 35 + substituteInPlace pytest_textual_snapshot.py \ 36 + --replace-fail \ 37 + "this_file_path.parent" \ 38 + "Path('$out/share/pytest-textual-snapshot/')" 39 + ''; 29 40 30 - buildInputs = [ pytest ]; 41 + build-system = [ poetry-core ]; 31 42 32 - propagatedBuildInputs = [ 43 + dependencies = [ 33 44 jinja2 45 + pytest 34 46 rich 35 47 syrupy 36 48 textual ··· 45 57 46 58 pythonImportsCheck = [ "pytest_textual_snapshot" ]; 47 59 48 - meta = with lib; { 60 + postInstall = '' 61 + mkdir -p $out/share/pytest-textual-snapshot/ 62 + cp -r resources $out/share/pytest-textual-snapshot/ 63 + ''; 64 + 65 + meta = { 49 66 description = "Snapshot testing for Textual applications"; 50 67 homepage = "https://github.com/Textualize/pytest-textual-snapshot"; 51 68 changelog = "https://github.com/Textualize/pytest-textual-snapshot/releases/tag/v${version}"; 52 - license = licenses.mit; 53 - maintainers = with maintainers; [ fab ]; 69 + license = lib.licenses.mit; 70 + maintainers = with lib.maintainers; [ fab ]; 54 71 }; 55 72 }
+14 -14
pkgs/development/python-modules/textual-autocomplete/default.nix
··· 1 1 { 2 2 lib, 3 - python3, 4 - fetchFromGitHub, 3 + buildPythonPackage, 4 + fetchPypi, 5 5 poetry-core, 6 6 textual, 7 7 typing-extensions, 8 8 hatchling, 9 9 }: 10 - python3.pkgs.buildPythonPackage rec { 11 - pname = "textual_autocomplete"; 12 - version = "3.0.0a13"; 10 + buildPythonPackage rec { 11 + pname = "textual-autocomplete"; 12 + version = "4.0.0a0"; 13 13 pyproject = true; 14 14 15 - src = fetchFromGitHub { 16 - owner = "darrenburns"; 17 - repo = "textual-autocomplete"; 18 - rev = "2cb572bf5b1ea0554b396d0833dfb398cb45dc9b"; 19 - hash = "sha256-jfGYC3xDspwEr+KGApGB05VFuzluDe5S9a/Sjg5HtdI="; 15 + src = fetchPypi { 16 + pname = "textual_autocomplete"; 17 + inherit version; 18 + hash = "sha256-wsjmgODvFgfbyqxW3jsH88JC8z0TZQOChLgics7wAHY="; 20 19 }; 21 20 22 - nativeBuildInputs = [ 21 + build-system = [ 23 22 poetry-core 24 23 hatchling 25 24 ]; 26 25 27 - pythonRelaxDeps = true; 28 - 29 26 dependencies = [ 30 27 textual 31 28 typing-extensions ··· 36 33 "typing_extensions" 37 34 ]; 38 35 36 + # No tests in the Pypi archive 37 + doCheck = false; 38 + 39 39 meta = { 40 40 description = "Python library that provides autocomplete capabilities to textual"; 41 - homepage = "https://pypi.org/project/textual-autocomplete"; 41 + homepage = "https://github.com/darrenburns/textual-autocomplete"; 42 42 license = lib.licenses.mit; 43 43 maintainers = with lib.maintainers; [ jorikvanveen ]; 44 44 };
+23 -6
pkgs/development/python-modules/textual-textarea/default.nix
··· 2 2 lib, 3 3 buildPythonPackage, 4 4 fetchFromGitHub, 5 + 6 + # build-system 5 7 poetry-core, 8 + 9 + # dependencies 6 10 pyperclip, 11 + textual, 12 + 13 + # tests 14 + pytestCheckHook, 7 15 pytest-asyncio, 8 - pytestCheckHook, 9 - pythonOlder, 10 - textual, 11 16 }: 12 17 13 18 buildPythonPackage rec { ··· 15 20 version = "0.15.0"; 16 21 pyproject = true; 17 22 18 - disabled = pythonOlder "3.8"; 19 - 20 23 src = fetchFromGitHub { 21 24 owner = "tconbeer"; 22 25 repo = "textual-textarea"; ··· 24 27 hash = "sha256-aaeXgD6RMQ3tlK5H/2lk3ueTyA3yYjHrYL51w/1tvSI="; 25 28 }; 26 29 30 + patches = [ 31 + # https://github.com/tconbeer/textual-textarea/issues/296 32 + ./textual-2.0.0.diff 33 + ]; 34 + 35 + pythonRelaxDeps = [ 36 + "textual" 37 + ]; 38 + 27 39 build-system = [ poetry-core ]; 28 40 29 41 dependencies = [ ··· 32 44 ] ++ textual.optional-dependencies.syntax; 33 45 34 46 nativeCheckInputs = [ 35 - pytest-asyncio 36 47 pytestCheckHook 48 + pytest-asyncio 37 49 ]; 38 50 39 51 pythonImportsCheck = [ "textual_textarea" ]; 52 + 53 + disabledTestPaths = [ 54 + # https://github.com/tconbeer/textual-textarea/issues/296 55 + "tests/functional_tests/test_textarea.py" 56 + ]; 40 57 41 58 meta = { 42 59 description = "A text area (multi-line input) with syntax highlighting for Textual";
+48
pkgs/development/python-modules/textual-textarea/textual-2.0.0.diff
··· 1 + diff --git a/src/textual_textarea/autocomplete.py b/src/textual_textarea/autocomplete.py 2 + index 51fa81d..a64f9ab 100644 3 + --- a/src/textual_textarea/autocomplete.py 4 + +++ b/src/textual_textarea/autocomplete.py 5 + @@ -13,7 +13,7 @@ from textual.message import Message 6 + from textual.reactive import Reactive, reactive 7 + from textual.widget import Widget 8 + from textual.widgets import OptionList 9 + -from textual.widgets._option_list import NewOptionListContent 10 + +from textual.widgets._option_list import OptionListContent 11 + from textual.widgets.option_list import Option 12 + 13 + from textual_textarea.messages import TextAreaHideCompletionList 14 + @@ -44,6 +44,8 @@ class CompletionList(OptionList, can_focus=False, inherit_bindings=False): 15 + width: 40; 16 + max-height: 8; 17 + display: none; 18 + + text-wrap: nowrap; 19 + + text-overflow: ellipsis; 20 + } 21 + CompletionList.open { 22 + display: block; 23 + @@ -71,14 +73,14 @@ class CompletionList(OptionList, can_focus=False, inherit_bindings=False): 24 + 25 + def __init__( 26 + self, 27 + - *content: NewOptionListContent, 28 + + *content: OptionListContent, 29 + name: str | None = None, 30 + id: str | None = None, # noqa: A002 31 + classes: str | None = None, 32 + disabled: bool = False, 33 + ): 34 + super().__init__( 35 + - *content, name=name, id=id, classes=classes, disabled=disabled, wrap=False 36 + + *content, name=name, id=id, classes=classes, disabled=disabled 37 + ) 38 + 39 + def set_offset(self, x_offset: int, y_offset: int) -> None: 40 + @@ -187,7 +189,7 @@ class CompletionList(OptionList, can_focus=False, inherit_bindings=False): 41 + self.y_offset, 42 + ) 43 + 44 + - self.add_options(items=items) 45 + + self.add_options(new_options=items) 46 + self.action_first() 47 + self.additional_x_offset = additional_x_offset 48 + self.is_open = True
+13 -20
pkgs/development/python-modules/textual/default.nix
··· 23 23 pytestCheckHook, 24 24 syrupy, 25 25 time-machine, 26 - pythonAtLeast, 27 26 }: 28 27 29 28 buildPythonPackage rec { 30 29 pname = "textual"; 31 - version = "1.0.0"; 30 + version = "2.1.2"; 32 31 pyproject = true; 33 32 34 33 src = fetchFromGitHub { 35 34 owner = "Textualize"; 36 35 repo = "textual"; 37 36 tag = "v${version}"; 38 - hash = "sha256-3pNUDkkq9X3W9DdWp4M4h4ddHN+GzUxLCFNJJdAtRJM="; 37 + hash = "sha256-VKo1idLu5sYGtuK8yZzVE6QrrMOciYIesbGVlqzNjfk="; 39 38 }; 40 39 41 40 build-system = [ poetry-core ]; ··· 75 74 "tests/test_focus.py" 76 75 ]; 77 76 78 - disabledTests = 79 - [ 80 - # Assertion issues 81 - "test_textual_env_var" 77 + disabledTests = [ 78 + # Assertion issues 79 + "test_textual_env_var" 82 80 83 - # Requirements for tests are not quite ready 84 - "test_register_language" 81 + # Requirements for tests are not quite ready 82 + "test_register_language" 85 83 86 - # Requires python bindings for tree-sitter languages 87 - # https://github.com/Textualize/textual/issues/5449 88 - "test_setting_unknown_language" 89 - "test_update_highlight_query" 90 - ] 91 - ++ lib.optionals (pythonAtLeast "3.13") [ 92 - # https://github.com/Textualize/textual/issues/5327 93 - "test_cursor_page_up" 94 - "test_cursor_page_down" 95 - ]; 84 + # Requires python bindings for tree-sitter languages 85 + # https://github.com/Textualize/textual/issues/5449 86 + "test_setting_unknown_language" 87 + "test_update_highlight_query" 88 + ]; 96 89 97 90 # Some tests in groups require state from previous tests 98 91 # See https://github.com/Textualize/textual/issues/4924#issuecomment-2304889067 ··· 105 98 meta = { 106 99 description = "TUI framework for Python inspired by modern web development"; 107 100 homepage = "https://github.com/Textualize/textual"; 108 - changelog = "https://github.com/Textualize/textual/releases/tag/v${version}"; 101 + changelog = "https://github.com/Textualize/textual/blob/${src.tag}/CHANGELOG.md"; 109 102 license = lib.licenses.mit; 110 103 maintainers = with lib.maintainers; [ gepbird ]; 111 104 };