Skip to content

Commit e16780d

Browse files
committed
Address most initial PR comments
1 parent ec42862 commit e16780d

6 files changed

Lines changed: 11 additions & 14 deletions

File tree

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ repos:
66
- id: check-executables-have-shebangs
77
- id: check-merge-conflict
88
- id: check-toml
9-
- id: check-yaml
109
- id: detect-private-key
1110
- id: end-of-file-fixer
1211
- id: fix-byte-order-marker

pyproject.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ dev = [
4545
"ruff>=0.14.10",
4646
"typos",
4747
]
48-
quality = ["prek>=0.3.5"]
49-
test = [
50-
"codecov>=2.1",
51-
"coverage>=7.11",
52-
"pytest>=8.1.1",
53-
"pytest-cov>=5",
54-
"pytest-mock>=3.14.1",
55-
]
5648

5749
[project.urls]
5850
Homepage = "https://github.com/prompt-toolkit/python-prompt-toolkit"

src/prompt_toolkit/layout/containers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@
5353
from .utils import explode_text_fragments
5454

5555
if TYPE_CHECKING:
56-
from typing import TypeGuard
57-
58-
from typing_extensions import Protocol
56+
from typing import Protocol, TypeGuard
5957

6058
from prompt_toolkit.key_binding.key_bindings import NotImplementedOrNone
6159

src/prompt_toolkit/layout/dimension.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from __future__ import annotations
77

88
from collections.abc import Callable
9-
from typing import TYPE_CHECKING, Any
9+
from typing import TYPE_CHECKING
1010

1111
__all__ = [
1212
"Dimension",
@@ -171,7 +171,7 @@ def max_layout_dimensions(dimensions: list[Dimension]) -> Dimension:
171171

172172

173173
# Anything that can be converted to a dimension
174-
AnyDimension = None | int | Dimension | Callable[[], Any]
174+
AnyDimension = None | int | Dimension | Callable[[], "AnyDimension"]
175175

176176

177177
def to_dimension(value: AnyDimension) -> Dimension:

tests/test_key_binding.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ def create_background_task(coroutine, **kw):
4343
coroutine.close()
4444
return None
4545

46+
# Don't start background tasks for these tests. The `KeyProcessor`
47+
# wants to create a background task for flushing keys. We can ignore it
48+
# here for these tests.
49+
# This patch is not clean. In the future, when we can use Taskgroups,
50+
# the `Application` should pass its task group to the constructor of
51+
# `KeyProcessor`. That way, it doesn't have to do a lookup using
52+
# `get_app()`.
4653
app.create_background_task = create_background_task
4754

4855
with set_app(app):

tests/test_memory_leaks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def _count_prompt_session_instances() -> int:
1414
return len([obj for obj in objects if isinstance(obj, PromptSession)])
1515

1616

17+
# This test used to fail in GitHub CI, probably due to GC differences.
1718
def test_prompt_session_memory_leak() -> None:
1819
before_count = _count_prompt_session_instances()
1920

0 commit comments

Comments
 (0)