From e8971fca8dcd0ce9cf0c2944eb9ac07ade83e354 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 2 Feb 2025 05:58:09 -0600 Subject: [PATCH 1/6] py(deps) libtmux 0.40.1 -> 0.42.0 See also: https://libtmux.git-pull.com/history.html#libtmux-0-42-0-2025-02-02 --- pyproject.toml | 2 +- uv.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 088692aade..d4267b3528 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ include = [ { path = "conftest.py", format = "sdist" }, ] dependencies = [ - "libtmux~=0.40.1", + "libtmux~=0.42.0", "colorama>=0.3.9", "PyYAML>=6.0" ] diff --git a/uv.lock b/uv.lock index ffb5fd2cc2..94e8574413 100644 --- a/uv.lock +++ b/uv.lock @@ -375,11 +375,11 @@ wheels = [ [[package]] name = "libtmux" -version = "0.40.1" +version = "0.42.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/20/53/d30bf462b0a005e4541b1c217e15107970063aad99145a259d75b23d35bd/libtmux-0.40.1.tar.gz", hash = "sha256:98ffe2b4922449e89dcd0072e1852bcd5757944fd34159d70ed3e57df398796d", size = 318731 } +sdist = { url = "https://files.pythonhosted.org/packages/ea/79/630e2b1b271e59cc17988f9b5473ea17850555b7734f6df25be16f0bd6a2/libtmux-0.42.0.tar.gz", hash = "sha256:5a13bc98d85fdb7105eea880d8f7017c8c4cca6563485972dd4550c57b66ee6f", size = 318619 } wheels = [ - { url = "https://files.pythonhosted.org/packages/92/89/179a35a1f0964466bdeb8db2b3b071780693490abd10d28e151b51088747/libtmux-0.40.1-py3-none-any.whl", hash = "sha256:aa8bd4a052ed6ce2686f46fa884022d79e900321b17428e87cc5d1b91fcb6081", size = 56185 }, + { url = "https://files.pythonhosted.org/packages/51/6e/6c5e6512927b8ecc2d236dbe6ac9b756717869e80a5994ca3dcbc25f3403/libtmux-0.42.0-py3-none-any.whl", hash = "sha256:bd3ab89d4fae9422d4e1f2701383d147aff61fe630a001ccfa7fdd9a69c7972f", size = 56057 }, ] [[package]] @@ -1241,7 +1241,7 @@ testing = [ [package.metadata] requires-dist = [ { name = "colorama", specifier = ">=0.3.9" }, - { name = "libtmux", specifier = "~=0.40.1" }, + { name = "libtmux", specifier = "~=0.42.0" }, { name = "pyyaml", specifier = ">=6.0" }, ] From d95da0a0d1f4da68df53ecb534cfbad6e9134830 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 2 Feb 2025 06:02:01 -0600 Subject: [PATCH 2/6] run_before_script: Remove reliance on `console_to_str()` --- src/tmuxp/util.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tmuxp/util.py b/src/tmuxp/util.py index b81fdb6e7e..a8ba93e753 100644 --- a/src/tmuxp/util.py +++ b/src/tmuxp/util.py @@ -9,8 +9,6 @@ import sys import typing as t -from libtmux._compat import console_to_str - from . import exc if t.TYPE_CHECKING: @@ -37,16 +35,17 @@ def run_before_script( stderr=subprocess.PIPE, stdout=subprocess.PIPE, cwd=cwd, + text=True, ) if proc.stdout is not None: - for line in iter(proc.stdout.readline, b""): - sys.stdout.write(console_to_str(line)) + for line in iter(proc.stdout.readline, ""): + sys.stdout.write(line) proc.wait() if proc.returncode and proc.stderr is not None: stderr = proc.stderr.read() proc.stderr.close() - stderr_strlist = console_to_str(stderr).split("\n") + stderr_strlist = stderr.split("\n") stderr_str = "\n".join(list(filter(None, stderr_strlist))) # filter empty raise exc.BeforeLoadScriptError( From 53a253b7fde9e7bc4f1ad4d9952498dd5e7113d3 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 2 Feb 2025 06:37:43 -0600 Subject: [PATCH 3/6] run_before_script: Pass `backslashreplace` for `errors` in `subprocess` More resilience for commands across systems. Ability to debug because escape sequences preserves the byte value for debugging. --- src/tmuxp/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tmuxp/util.py b/src/tmuxp/util.py index a8ba93e753..849fee67d3 100644 --- a/src/tmuxp/util.py +++ b/src/tmuxp/util.py @@ -36,6 +36,7 @@ def run_before_script( stdout=subprocess.PIPE, cwd=cwd, text=True, + errors="backslashreplace", ) if proc.stdout is not None: for line in iter(proc.stdout.readline, ""): From 376525eb228466e9de77607b7a1e87dd47750f15 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 2 Feb 2025 06:40:03 -0600 Subject: [PATCH 4/6] run_before_script: Use UTF-8 decoding instead of system's locale --- src/tmuxp/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tmuxp/util.py b/src/tmuxp/util.py index 849fee67d3..893b73d379 100644 --- a/src/tmuxp/util.py +++ b/src/tmuxp/util.py @@ -37,6 +37,7 @@ def run_before_script( cwd=cwd, text=True, errors="backslashreplace", + encoding="utf-8", ) if proc.stdout is not None: for line in iter(proc.stdout.readline, ""): From 919324f6c07cde02372080f645444c861a67eab8 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 2 Feb 2025 06:08:21 -0600 Subject: [PATCH 5/6] docs(CHANGES) Note libtmux bump --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 6ce59c1d8a..22e3f9cd7a 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,12 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force +### Development + +- libtmux: Bump minimum version from 0.40.1 -> 0.42.0 (#958) + + - `run_before_script()`: Remove reliance on `console_to_str()` + ## tmuxp 1.51.0 (2025-02-02) _Maintenance only, no bug fixes or new features_ From 425bf3c80eeba862fba2a1e912bfe16683a0b108 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 2 Feb 2025 06:45:29 -0600 Subject: [PATCH 6/6] Tag v1.52.0 (libtmux 0.42.0) --- CHANGES | 6 +++++- pyproject.toml | 2 +- src/tmuxp/__about__.py | 2 +- uv.lock | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 22e3f9cd7a..30491ec723 100644 --- a/CHANGES +++ b/CHANGES @@ -15,10 +15,14 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force // Usage: tmuxp@next load yoursession ``` -## tmuxp 1.52.0 (unreleased) +## tmuxp 1.53.0 (unreleased) +## tmuxp 1.52.0 (2025-02-02) + +_Maintenance only, no bug fixes or new features_ + ### Development - libtmux: Bump minimum version from 0.40.1 -> 0.42.0 (#958) diff --git a/pyproject.toml b/pyproject.toml index d4267b3528..cd4400fe8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "tmuxp" -version = "1.51.0" +version = "1.52.0" description = "Session manager for tmux, which allows users to save and load tmux sessions through simple configuration files." requires-python = ">=3.9,<4.0" authors = [ diff --git a/src/tmuxp/__about__.py b/src/tmuxp/__about__.py index 222c4e7e70..06200b0952 100644 --- a/src/tmuxp/__about__.py +++ b/src/tmuxp/__about__.py @@ -4,7 +4,7 @@ __title__ = "tmuxp" __package_name__ = "tmuxp" -__version__ = "1.51.0" +__version__ = "1.52.0" __description__ = "tmux session manager" __email__ = "tony@git-pull.com" __author__ = "Tony Narlock" diff --git a/uv.lock b/uv.lock index 94e8574413..e10f6061c0 100644 --- a/uv.lock +++ b/uv.lock @@ -1157,7 +1157,7 @@ wheels = [ [[package]] name = "tmuxp" -version = "1.51.0" +version = "1.52.0" source = { editable = "." } dependencies = [ { name = "colorama" },