Skip to content

Commit 1b77683

Browse files
authored
Doc fixes (#612)
2 parents e2a91de + 4747050 commit 1b77683

File tree

15 files changed

+161
-84
lines changed

15 files changed

+161
-84
lines changed

CHANGES

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ $ uvx --from 'libtmux' --prerelease allow python
3232

3333
<!-- To maintainers and contributors: Please add notes for the forthcoming version below -->
3434

35-
_Future release notes will be placed here_
35+
_Upcoming changes will be written here._
36+
37+
### Documentation (#612)
38+
39+
- Normalize docs headings and Sphinx module directives to fix anchor and index generation issues.
40+
- Tweak Sphinx type-hints configuration to avoid RST indentation conflicts and suppress forward-reference warnings.
41+
- Refresh docstrings and cross-references (pane/window APIs, environment helpers, pytest plugin) for clearer return types and stable anchors.
42+
- Fix incorrect return type annotations for `capture_pane()` and `display_message()` methods
43+
(changed from `str | list[str]` to `list[str]` - the methods always return a list).
3644

3745
## libtmux 0.50.0 (2025-11-30)
3846

@@ -55,7 +63,7 @@ unified, typed API for managing tmux options and hooks across all object types.
5563

5664
### What's New
5765

58-
#### Unified Options API (#516)
66+
### Unified Options API (#516)
5967

6068
All tmux objects now share a consistent options interface through
6169
{class}`~options.OptionsMixin`:
@@ -104,7 +112,7 @@ window.unset_option('automatic-rename')
104112
| `suppress_warnings` | `-q` | Suppress warnings |
105113
| `append` | `-a` | Append to existing value |
106114

107-
#### Hook Management (#516)
115+
### Hook Management (#516)
108116

109117
New {class}`~hooks.HooksMixin` provides programmatic control over tmux hooks:
110118

@@ -151,7 +159,7 @@ session.set_hooks('session-renamed', {
151159
| `run_hook(hook)` | Run a hook immediately |
152160
| `set_hooks(hook, values)` | Set multiple indexed hooks at once |
153161

154-
#### SparseArray for Indexed Options (#516)
162+
### SparseArray for Indexed Options (#516)
155163

156164
tmux uses sparse indexed arrays for options like `command-alias[0]`,
157165
`command-alias[99]`, `terminal-features[0]`. Python lists can't represent
@@ -173,15 +181,15 @@ gaps in indices, so libtmux introduces {class}`~_internal.sparse_array.SparseArr
173181
['first', 'ninety-ninth']
174182
```
175183

176-
#### New Constants (#516)
184+
### New Constants (#516)
177185

178186
- {class}`~constants.OptionScope` enum: `Server`, `Session`, `Window`, `Pane`
179187
- `OPTION_SCOPE_FLAG_MAP`: Maps scope to tmux flags (`-s`, `-w`, `-p`)
180188
- `HOOK_SCOPE_FLAG_MAP`: Maps scope to hook flags
181189

182190
### Breaking changes
183191

184-
#### Deprecated Window methods (#516)
192+
### Deprecated Window methods (#516)
185193

186194
The following methods are deprecated and will be removed in a future release:
187195

@@ -214,7 +222,7 @@ window.set_option('automatic-rename', True)
214222

215223
### Breaking Changes
216224

217-
#### tmux 1.8 to 3.1c support removed (#608)
225+
### tmux 1.8 to 3.1c support removed (#608)
218226

219227
Support for tmux versions below 3.2a has been removed. This completes the
220228
deprecation announced in v0.48.0.
@@ -228,7 +236,7 @@ deprecation announced in v0.48.0.
228236

229237
### Breaking Changes
230238

231-
#### Minimum tmux version bumped to 3.2+ (606)
239+
### Minimum tmux version bumped to 3.2+ (606)
232240

233241
tmux versions below 3.2a are now deprecated. libtmux 0.48.0 will be the last
234242
version to support tmux below 3.2. This is to ensure support for hooks, options,
@@ -243,7 +251,7 @@ release. Set `LIBTMUX_SUPPRESS_VERSION_WARNING=1` to suppress the warning.
243251

244252
### What's new
245253

246-
#### tmux 3.6 support (#607)
254+
### tmux 3.6 support (#607)
247255

248256
Added tmux 3.6 to test grid and `TMUX_MAX_VERSION` 3.4 -> 3.6.
249257

@@ -288,7 +296,7 @@ be a few months in waiting (watchers / snapshots are in development in #587).
288296

289297
### Breaking
290298

291-
#### Imports removed from libtmux.test (#580)
299+
### Imports removed from libtmux.test (#580)
292300

293301
Root-level of imports from `libtmux.test` are no longer possible.
294302

@@ -324,7 +332,7 @@ from libtmux.test.constants import (
324332

325333
### Development
326334

327-
#### Test helpers: Increased coverage (#580)
335+
### Test helpers: Increased coverage (#580)
328336

329337
Several improvements to the test helper modules:
330338

@@ -338,7 +346,7 @@ Several improvements to the test helper modules:
338346

339347
### Breaking Changes
340348

341-
#### Test helpers: Refactor
349+
### Test helpers: Refactor
342350

343351
Test helper functionality has been split into focused modules (#578):
344352

@@ -403,7 +411,7 @@ from libtmux.test.temporary import temp_session, temp_window
403411

404412
### New Features
405413

406-
#### Context Managers support (#566)
414+
### Context Managers support (#566)
407415

408416
Added context manager support for all major object types:
409417

@@ -430,7 +438,7 @@ This makes it easier to write clean, safe code that properly cleans up tmux reso
430438

431439
### New Features
432440

433-
#### Server Initialization Callbacks
441+
### Server Initialization Callbacks
434442

435443
Server now accepts 2 new optional params, `socket_name_factory` and `on_init` callbacks (#565):
436444

@@ -439,7 +447,7 @@ Server now accepts 2 new optional params, `socket_name_factory` and `on_init` ca
439447
- Useful for creating multiple servers with unique names and tracking server instances
440448
- Socket name factory is tried after socket_name, maintaining backward compatibility
441449

442-
#### New test fixture: `TestServer`
450+
### New test fixture: `TestServer`
443451

444452
Add `TestServer` pytest fixture for creating temporary tmux servers (#565):
445453

@@ -493,7 +501,7 @@ Add `TestServer` pytest fixture for creating temporary tmux servers (#565):
493501

494502
### Development
495503

496-
#### chore: Implement PEP 563 deferred annotation resolution (#555)
504+
### chore: Implement PEP 563 deferred annotation resolution (#555)
497505

498506
- Add `from __future__ import annotations` to defer annotation resolution and reduce unnecessary runtime computations during type checking.
499507
- Enable Ruff checks for PEP-compliant annotations:
@@ -549,13 +557,13 @@ _Maintenance only, no bug fixes or new features_
549557

550558
### Breaking changes
551559

552-
#### Project and package management: poetry to uv (#547)
560+
### Project and package management: poetry to uv (#547)
553561

554562
[uv] is the new package and project manager for the project, replacing Poetry.
555563

556564
[uv]: https://github.com/astral-sh/uv
557565

558-
#### Build system: poetry to hatchling (#547)
566+
### Build system: poetry to hatchling (#547)
559567

560568
[Build system] moved from [poetry] to [hatchling].
561569

@@ -569,8 +577,6 @@ _Maintenance only, no bug fixes or new features_
569577

570578
via [ruff 0.4.2](https://github.com/astral-sh/ruff/blob/v0.4.2/CHANGELOG.md).
571579

572-
[uv]: https://github.com/astral-sh/uv
573-
574580
### Documentation
575581

576582
- Fix docstrings in `query_list` for `MultipleObjectsReturned` and
@@ -659,7 +665,7 @@ _Maintenance only, no bug fixes or new features_
659665

660666
### Breaking changes
661667

662-
#### Command target change (#535)
668+
### Command target change (#535)
663669

664670
Commands: All `cmd()` methods using custom or overridden targets must use the keyword argument
665671
`target`. This avoids entanglement with inner shell values that include `-t` for
@@ -674,7 +680,7 @@ other purposes. These methods include:
674680

675681
### Breaking changes
676682

677-
#### Improved new sessions (#532)
683+
### Improved new sessions (#532)
678684

679685
- `Session.new_window()`:
680686

@@ -686,7 +692,7 @@ other purposes. These methods include:
686692

687693
[PEP 3102]: https://www.python.org/dev/peps/pep-3102/
688694

689-
#### Improved window splitting (#532)
695+
### Improved window splitting (#532)
690696

691697
- `Window.split_window()` to {meth}`Window.split()`
692698

@@ -701,7 +707,7 @@ other purposes. These methods include:
701707

702708
- Learned `zoom`
703709

704-
#### Tweak: Pane position (#532)
710+
### Tweak: Pane position (#532)
705711

706712
It's now possible to retrieve the position of a pane in a window via a
707713
`bool` helper::
@@ -811,31 +817,31 @@ _Maintenance only, no bug fixes or new features_
811817

812818
## libtmux 0.29.0 (2024-02-16)
813819

814-
#### Fixes
820+
### Fixes
815821

816822
- Use {exc}`DeprecationWarning` for APIs set to be deprecated (#526)
817823

818-
#### Testing
824+
### Testing
819825

820826
- pytest: Ignore {exc}`DeprecationWarning` by default (#526)
821827

822828
## libtmux 0.28.1 (2024-02-15)
823829

824830
_Maintenance only, no bug fixes or new features_
825831

826-
#### Testing
832+
### Testing
827833

828834
- CI: Bump actions to node 20+ versions
829835

830-
#### Documentation
836+
### Documentation
831837

832838
- Refine docs and add migration for v0.28.0
833839

834840
## libtmux 0.28.0 (2024-02-14)
835841

836842
### Breaking changes
837843

838-
#### Detached / unselected by default (#523)
844+
### Detached / unselected by default (#523)
839845

840846
To ensure consistency and principle of least surprise, keep these set to
841847
not use `-a` unless explicitly specified.
@@ -1240,7 +1246,7 @@ _Maintenance only, no bug fixes or new features_
12401246

12411247
### New features
12421248

1243-
#### Detect if server active (#448)
1249+
### Detect if server active (#448)
12441250

12451251
- `Server.is_alive()`
12461252
- `Server.raise_if_dead()`
@@ -1583,10 +1589,8 @@ _Maintenance only, no bug fixes or new features_
15831589

15841590
- Python 3.7 and 3.8 returns in 0.12.0
15851591

1586-
~~Final python 3.7 and 3.8 release~~
1587-
1588-
~~Fixes and security updates will go to
1589-
[`v0.11.x`](https://github.com/tmux-python/libtmux/tree/v0.11.x)~~
1592+
*Note: This was not the final Python 3.7 and 3.8 release as originally stated.
1593+
Python 3.7 and 3.8 support was extended in 0.12.0.*
15901594

15911595
- Internal: Use new separator to split `tmux(1)` formatting information (#289,
15921596
#343)

MIGRATION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Using the old `g` parameter will emit a {class}`DeprecationWarning`.
114114

115115
## libtmux 0.46.0 (2025-02-25)
116116

117-
#### Imports removed from libtmux.test (#580)
117+
### Imports removed from libtmux.test (#580)
118118

119119
Root-level of imports from `libtmux.test` are no longer possible.
120120

@@ -230,7 +230,7 @@ from libtmux.test.temporary import temp_session, temp_window
230230

231231
## 0.28.0: Resizing and detached by default (2024-02-15)
232232

233-
#### Detach by default
233+
### Detach by default
234234

235235
- {meth}`Session.new_window()` + {meth}`Window.split_window()` no longer attaches by default (#523)
236236

@@ -239,7 +239,7 @@ from libtmux.test.temporary import temp_session, temp_window
239239

240240
For the old behavior in 0.28.0 and beyond, pass `attach=True` explicitly.
241241

242-
#### Resizing panes
242+
### Resizing panes
243243

244244
- `Pane.resize_pane()` renamed to {meth}`Pane.resize()` (via #523)
245245

docs/about.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
(internals)=
2-
31
(about)=
42

53
# About

docs/api/windows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- Identified by `@`, e.g. `@313`
88

99
```{module} libtmux
10-
10+
:no-index:
1111
```
1212

1313
```{eval-rst}

docs/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@
118118
autodoc_class_signature = "separated"
119119
toc_object_entries_show_parents = "hide"
120120

121+
# sphinx-autodoc-typehints
122+
# Suppress warnings for forward references that can't be resolved
123+
# (types in TYPE_CHECKING blocks used for circular import avoidance)
124+
suppress_warnings = [
125+
"sphinx_autodoc_typehints.forward_reference",
126+
]
127+
121128
# sphinx-copybutton
122129
copybutton_prompt_text = (
123130
r">>> |\.\.\. |> |\$ |\# | In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "

docs/pytest-plugin/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ your case, we won't stabilize APIs until we're sure everything is by the book.
1212
1313
[connect with us]: https://github.com/tmux-python/libtmux/discussions
1414
15-
```
16-
1715
```{module} libtmux.pytest_plugin
18-
16+
:no-index:
1917
```
2018

2119
## Usage
@@ -59,6 +57,8 @@ These fixtures are automatically used when the plugin is enabled and `pytest` is
5957

6058
These are set to ensure panes and windows can be reliably referenced and asserted.
6159

60+
(setting_a_tmux_configuration)=
61+
6262
## Setting a tmux configuration
6363

6464
If you would like {func}`session fixture <libtmux.pytest_plugin.session>` to automatically use a configuration, you have a few
@@ -108,7 +108,7 @@ def test_something(TestServer):
108108
assert server.is_alive()
109109
```
110110

111-
You can also use it with custom configurations, similar to the {ref}`server fixture <Setting a tmux configuration>`:
111+
You can also use it with custom configurations, similar to the {ref}`server fixture <setting_a_tmux_configuration>`:
112112

113113
```python
114114
def test_with_config(TestServer, tmp_path):

docs/quickstart.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ $ ptpython
129129
```
130130

131131
```{module} libtmux
132-
132+
:no-index:
133133
```
134134

135135
First, we can grab a {class}`Server`.
@@ -491,4 +491,3 @@ and our [test suite] (see {ref}`development`.)
491491

492492
[workspacebuilder.py]: https://github.com/tmux-python/libtmux/blob/master/libtmux/workspacebuilder.py
493493
[test suite]: https://github.com/tmux-python/libtmux/tree/master/tests
494-
[ptpython]: https://github.com/prompt-toolkit/ptpython

0 commit comments

Comments
 (0)