Remove TreeNode as a pseudo-widget

This encourages importing it from `textual.widgets.tree` instead, keeping it
in line with the other changes made for #1637.

Note this is a breaking change.
This commit is contained in:
Dave Pearson 2023-01-23 17:37:58 +00:00
parent d4c71588a7
commit 4adfe69ec9
No known key found for this signature in database
GPG key ID: B413E0EF113D4ABF
6 changed files with 7 additions and 7 deletions

View file

@ -4,7 +4,8 @@ from pathlib import Path
from rich.text import Text
from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, Tree, TreeNode
from textual.widgets import Header, Footer, Tree
from textual.widgets.tree import TreeNode
class TreeApp(App):

View file

@ -23,7 +23,6 @@ if typing.TYPE_CHECKING:
from ._static import Static
from ._text_log import TextLog
from ._tree import Tree
from ._tree_node import TreeNode
from ._welcome import Welcome
from ..widget import Widget
@ -44,7 +43,6 @@ __all__ = [
"Static",
"TextLog",
"Tree",
"TreeNode",
"Welcome",
]

View file

@ -1 +0,0 @@
from ._tree import TreeNode as TreeNode

View file

@ -1,5 +1,6 @@
import pytest
from textual.widgets import Tree, TreeNode
from textual.widgets import Tree
from textual.widgets.tree import TreeNode
def label_of(node: TreeNode[None]):

View file

@ -1,4 +1,5 @@
from textual.widgets import Tree, TreeNode
from textual.widgets import Tree
from textual.widgets.tree import TreeNode
from rich.text import Text

View file

@ -1,4 +1,4 @@
from textual.widgets import TreeNode, Tree
from textual.widgets import Tree
def test_tree_node_parent() -> None: