Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.14']
python-version: ['3.14']
tmux-version: ['2.6', '2.7', '2.8', '3.0a', '3.1b', '3.2a', '3.3a', '3.4', '3.5', 'master']
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ $ pip install --user --upgrade --pre libtmux

- _Future release notes will be placed here_

### Breaking changes

- Drop support for Python 3.9; the new minimum is Python 3.10 (#602). See also:
- [Python 3.9 EOL timeline](https://devguide.python.org/versions/#:~:text=Release%20manager-,3.9,-PEP%20596)
- [PEP 596](https://peps.python.org/pep-0596/)

### Development

- Add Python 3.14 to test matrix (#601)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ See donation options at <https://tony.sh/support.html>.
# Project details

- tmux support: 1.8+
- python support: >= 3.9, pypy, pypy3
- python support: >= 3.10, pypy, pypy3
- Source: <https://github.com/tmux-python/libtmux>
- Docs: <https://libtmux.git-pull.com>
- API: <https://libtmux.git-pull.com/api.html>
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "libtmux"
version = "0.46.2"
description = "Typed library that provides an ORM wrapper for tmux, a terminal multiplexer."
requires-python = ">=3.9,<4.0"
requires-python = ">=3.10,<4.0"
authors = [
{name = "Tony Narlock", email = "[email protected]"}
]
Expand All @@ -16,7 +16,6 @@ classifiers = [
"Framework :: Pytest",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down Expand Up @@ -122,7 +121,7 @@ build-backend = "hatchling.build"

[tool.mypy]
strict = true
python_version = "3.9"
python_version = "3.10"
files = [
"src",
"tests",
Expand Down Expand Up @@ -156,7 +155,7 @@ exclude_lines = [
]

[tool.ruff]
target-version = "py39"
target-version = "py310"

[tool.ruff.lint]
select = [
Expand Down
2 changes: 1 addition & 1 deletion src/libtmux/_internal/query_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def __eq__(
return False

if len(self) == len(data):
for a, b in zip(self, data):
for a, b in zip(self, data, strict=False):
if isinstance(a, Mapping):
a_keys = a.keys()
if a.keys == b.keys():
Expand Down
3 changes: 1 addition & 2 deletions src/libtmux/_internal/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

if t.TYPE_CHECKING:
from os import PathLike

from typing_extensions import TypeAlias
from typing import TypeAlias

StrPath: TypeAlias = "str | PathLike[str]"
21 changes: 7 additions & 14 deletions src/libtmux/_vendor/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,13 @@

__all__ = ["VERSION_PATTERN", "InvalidVersion", "Version", "parse"]

InfiniteTypes = t.Union[InfinityType, NegativeInfinityType]
PrePostDevType = t.Union[InfiniteTypes, tuple[str, int]]
SubLocalType = t.Union[InfiniteTypes, int, str]
LocalType = t.Union[
NegativeInfinityType,
tuple[
t.Union[
SubLocalType,
tuple[SubLocalType, str],
tuple[NegativeInfinityType, SubLocalType],
],
...,
],
]
InfiniteTypes = InfinityType | NegativeInfinityType
PrePostDevType = InfiniteTypes | tuple[str, int]
SubLocalType = InfiniteTypes | int | str
LocalTuple = (
SubLocalType | tuple[SubLocalType, str] | tuple[NegativeInfinityType, SubLocalType]
)
LocalType = NegativeInfinityType | tuple[LocalTuple, ...]
CmpKey = tuple[
int,
tuple[int, ...],
Expand Down
10 changes: 5 additions & 5 deletions src/libtmux/neo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

if t.TYPE_CHECKING:
ListCmd = t.Literal["list-sessions", "list-windows", "list-panes"]
ListExtraArgs = t.Optional[Iterable[str]]
ListExtraArgs = Iterable[str] | None

from libtmux.server import Server

Expand Down Expand Up @@ -174,7 +174,7 @@ def _refresh(
obj_key: str,
obj_id: str,
list_cmd: ListCmd = "list-panes",
list_extra_args: ListExtraArgs | None = None,
list_extra_args: ListExtraArgs = None,
) -> None:
assert isinstance(obj_id, str)
obj = fetch_obj(
Expand All @@ -193,7 +193,7 @@ def _refresh(
def fetch_objs(
server: Server,
list_cmd: ListCmd,
list_extra_args: ListExtraArgs | None = None,
list_extra_args: ListExtraArgs = None,
) -> OutputsRaw:
"""Fetch a listing of raw data from a tmux command."""
formats = list(Obj.__dataclass_fields__.keys())
Expand Down Expand Up @@ -224,7 +224,7 @@ def fetch_objs(
obj_output = proc.stdout

obj_formatters = [
dict(zip(formats, formatter.split(FORMAT_SEPARATOR)))
dict(zip(formats, formatter.split(FORMAT_SEPARATOR), strict=False))
for formatter in obj_output
]

Expand All @@ -237,7 +237,7 @@ def fetch_obj(
obj_key: str,
obj_id: str,
list_cmd: ListCmd = "list-panes",
list_extra_args: ListExtraArgs | None = None,
list_extra_args: ListExtraArgs = None,
) -> OutputRaw:
"""Fetch raw data from tmux command."""
obj_formatters_filtered = fetch_objs(
Expand Down
4 changes: 3 additions & 1 deletion src/libtmux/pane.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,9 @@ def split(

pane_output = pane_cmd.stdout[0]

pane_formatters = dict(zip(["pane_id"], pane_output.split(FORMAT_SEPARATOR)))
pane_formatters = dict(
zip(["pane_id"], pane_output.split(FORMAT_SEPARATOR), strict=False),
)

return self.from_pane_id(server=self.server, pane_id=pane_formatters["pane_id"])

Expand Down
15 changes: 8 additions & 7 deletions src/libtmux/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@
)

if t.TYPE_CHECKING:
import sys
import types
from typing import TypeAlias

from libtmux._internal.types import StrPath
from typing_extensions import Self

if sys.version_info >= (3, 10):
from typing import Self, TypeAlias
else:
from typing_extensions import Self, TypeAlias
from libtmux._internal.types import StrPath

DashLiteral: TypeAlias = t.Literal["-"]

Expand Down Expand Up @@ -580,7 +577,11 @@ def new_session(
os.environ["TMUX"] = env

session_formatters = dict(
zip(["session_id"], session_stdout.split(formats.FORMAT_SEPARATOR)),
zip(
["session_id"],
session_stdout.split(formats.FORMAT_SEPARATOR),
strict=False,
),
)

return Session.from_session_id(
Expand Down
2 changes: 1 addition & 1 deletion src/libtmux/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ def new_window(
window_output = cmd.stdout[0]

window_formatters = dict(
zip(["window_id"], window_output.split(FORMAT_SEPARATOR)),
zip(["window_id"], window_output.split(FORMAT_SEPARATOR), strict=False),
)

return Window.from_window_id(
Expand Down
7 changes: 1 addition & 6 deletions tests/legacy_api/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@
from libtmux._compat import LooseVersion

if t.TYPE_CHECKING:
import sys
from collections.abc import Callable

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias
from typing import TypeAlias

try:
from _pytest.raises import RaisesExc
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from libtmux.server import Server

ListCmd = t.Literal["list-sessions", "list-windows", "list-panes"]
ListExtraArgs = t.Optional[tuple[str]]
ListExtraArgs = tuple[str] | None


OutputRaw = dict[str, t.Any]
Expand Down
7 changes: 1 addition & 6 deletions tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@
from libtmux._compat import LooseVersion

if t.TYPE_CHECKING:
import sys
from collections.abc import Callable

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias
from typing import TypeAlias

try:
from _pytest.raises import RaisesExc
Expand Down
Loading