Skip to content

Commit 62c69d7

Browse files
committed
fix(snapshot): drop runtime typing_extensions import
why: CI matrix lacks typing_extensions in production deps; only Self is needed for typing, which 3.11+ provides natively. what: - Move Self import under TYPE_CHECKING + sys.version_info gate - Pattern matches existing libtmux/pane.py and window.py
1 parent 2e38969 commit 62c69d7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/libtmux/snapshot.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@
55
import dataclasses
66
import datetime
77
import json
8+
import sys
89
import typing as t
910
from abc import ABC, abstractmethod
1011

11-
from typing_extensions import Self
12-
1312
from libtmux.formats import PANE_FORMATS
1413

1514
if t.TYPE_CHECKING:
1615
from collections.abc import Iterator, Sequence
1716

1817
from libtmux.pane import Pane
1918

19+
if sys.version_info >= (3, 11):
20+
from typing import Self
21+
else:
22+
from typing_extensions import Self
23+
2024

2125
class SnapshotOutputAdapter(ABC):
2226
"""Base class for snapshot output adapters.

0 commit comments

Comments
 (0)