diff --git a/pkgs/by-name/me/memray/package.nix b/pkgs/by-name/me/memray/package.nix index 9c8a4a3f4c5c..cec89938e5e4 100644 --- a/pkgs/by-name/me/memray/package.nix +++ b/pkgs/by-name/me/memray/package.nix @@ -63,6 +63,11 @@ python3Packages.buildPythonApplication rec { disabledTestPaths = [ # Very time-consuming and some tests fails (performance-related?) "tests/integration/test_main.py" + + # AssertionError since textual was updated to 3.1.0 + # https://github.com/bloomberg/memray/issues/750 + "tests/unit/test_tree_reporter.py" + "tests/unit/test_tui_reporter.py" ]; meta = with lib; { diff --git a/pkgs/development/python-modules/textual-textarea/default.nix b/pkgs/development/python-modules/textual-textarea/default.nix index 712e4e36cdcc..9e6a02bf2c00 100644 --- a/pkgs/development/python-modules/textual-textarea/default.nix +++ b/pkgs/development/python-modules/textual-textarea/default.nix @@ -13,6 +13,7 @@ # tests pytestCheckHook, pytest-asyncio, + tree-sitter-python, }: buildPythonPackage rec { @@ -46,17 +47,27 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-asyncio + tree-sitter-python ]; pythonImportsCheck = [ "textual_textarea" ]; - disabledTestPaths = [ + pytestFlagsArray = [ + # "--deselect=tests/functional_tests/test_comments.py::test_comments[sql--- ]" + ]; + + disabledTests = [ + # Requires unpackaged tree-sitter-sql + # textual.widgets._text_area.LanguageDoesNotExist + "test_comments" + + # AssertionError: assert Selection(sta...), end=(0, 6)) == Selection(sta...), end=(1, 0)) # https://github.com/tconbeer/textual-textarea/issues/296 - "tests/functional_tests/test_textarea.py" + "test_keys" ]; meta = { - description = "A text area (multi-line input) with syntax highlighting for Textual"; + description = "Text area (multi-line input) with syntax highlighting for Textual"; homepage = "https://github.com/tconbeer/textual-textarea"; changelog = "https://github.com/tconbeer/textual-textarea/releases/tag/v${version}"; license = lib.licenses.mit; diff --git a/pkgs/development/python-modules/textual/default.nix b/pkgs/development/python-modules/textual/default.nix index 2dcdda0f152b..183a2dd67b7b 100644 --- a/pkgs/development/python-modules/textual/default.nix +++ b/pkgs/development/python-modules/textual/default.nix @@ -23,18 +23,20 @@ pytestCheckHook, syrupy, time-machine, + tree-sitter-markdown, + tree-sitter-python, }: buildPythonPackage rec { pname = "textual"; - version = "2.1.2"; + version = "3.1.0"; pyproject = true; src = fetchFromGitHub { owner = "Textualize"; repo = "textual"; tag = "v${version}"; - hash = "sha256-VKo1idLu5sYGtuK8yZzVE6QrrMOciYIesbGVlqzNjfk="; + hash = "sha256-JBqzaSsLSCzUYdIjlPZdPJlRKrqtWWPqJPp85uMcMLc="; }; build-system = [ poetry-core ]; @@ -63,33 +65,25 @@ buildPythonPackage rec { syrupy time-machine tree-sitter + tree-sitter-markdown + tree-sitter-python ]; disabledTestPaths = [ # Snapshot tests require syrupy<4 "tests/snapshot_tests/test_snapshots.py" - - # Flaky: https://github.com/Textualize/textual/issues/5511 - # RuntimeError: There is no current event loop in thread 'MainThread'. - "tests/test_focus.py" ]; disabledTests = [ # Assertion issues "test_textual_env_var" - - # Requirements for tests are not quite ready - "test_register_language" - - # Requires python bindings for tree-sitter languages - # https://github.com/Textualize/textual/issues/5449 - "test_setting_unknown_language" - "test_update_highlight_query" ]; - # Some tests in groups require state from previous tests - # See https://github.com/Textualize/textual/issues/4924#issuecomment-2304889067 - pytestFlagsArray = [ "--dist=loadgroup" ]; + pytestFlagsArray = [ + # Some tests in groups require state from previous tests + # See https://github.com/Textualize/textual/issues/4924#issuecomment-2304889067 + "--dist=loadgroup" + ]; pythonImportsCheck = [ "textual" ]; diff --git a/pkgs/development/python-modules/tree-sitter-markdown/default.nix b/pkgs/development/python-modules/tree-sitter-markdown/default.nix new file mode 100644 index 000000000000..394b5467a537 --- /dev/null +++ b/pkgs/development/python-modules/tree-sitter-markdown/default.nix @@ -0,0 +1,46 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + tree-sitter, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "tree-sitter-markdown"; + version = "0.4.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "tree-sitter-grammars"; + repo = "tree-sitter-markdown"; + tag = "v${version}"; + hash = "sha256-Oe2iL5b1Cyv+dK0nQYFNLCCOCe+93nojxt6ukH2lEmU="; + }; + + build-system = [ + setuptools + ]; + + optional-dependencies = { + core = [ + tree-sitter + ]; + }; + + pythonImportsCheck = [ "tree_sitter_markdown" ]; + + nativeCheckInputs = [ + pytestCheckHook + tree-sitter + ]; + + meta = { + description = "Markdown grammar for tree-sitter"; + homepage = "https://github.com/tree-sitter-grammars/tree-sitter-markdown"; + changelog = "https://github.com/tree-sitter-grammars/tree-sitter-markdown/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 319446954554..83003a8ff767 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17499,6 +17499,8 @@ self: super: with self; { tree-sitter-make = callPackage ../development/python-modules/tree-sitter-make { }; + tree-sitter-markdown = callPackage ../development/python-modules/tree-sitter-markdown { }; + tree-sitter-python = callPackage ../development/python-modules/tree-sitter-python { }; tree-sitter-rust = callPackage ../development/python-modules/tree-sitter-rust { };