Skip to content

Commit 39a5dc6

Browse files
authored
ci(tests) Verify runtime deps, fix runtime dep issue (#965)
## Changes - Add runtime dependency check in CI using `uv run --no-dev` - Run check before installing dev dependencies - Print package version and basic functionality test results - Document improvement in CHANGES - Fix runtime issue in _internal/types.py ## Verification https://github.com/tmux-python/tmuxp/actions/runs/13411308953/job/37461974473#step:5:24 uv run --no-dev -p python3.13 -- python -c ' from tmuxp import _internal, cli, workspace, exc, log, plugin, shell, types, util, __version__ from tmuxp._internal import config_reader, types from tmuxp.workspace import builder, constants, finders, freezer, importers, loader, validation from libtmux import __version__ as __libtmux_version__ print("tmuxp version:", __version__) print("libtmux version:", __libtmux_version__) ' shell: /usr/bin/bash -e {0} env: UV_CACHE_DIR: /home/runner/work/_temp/setup-uv-cache Using CPython 3.13.2 Creating virtual environment at: .venv Building tmuxp @ file:///home/runner/work/tmuxp/tmuxp Built tmuxp @ file:///home/runner/work/tmuxp/tmuxp Installed 4 packages in 1ms Traceback (most recent call last): File "<string>", line 3, in <module> from tmuxp._internal import config_reader, types File "/home/runner/work/tmuxp/tmuxp/src/tmuxp/_internal/types.py", line 15, in <module> from typing_extensions import NotRequired, TypedDict ModuleNotFoundError: No module named 'typing_extensions' ## See also - tmux-python/libtmux#574 ## Summary by Sourcery CI: - Adds a CI job to verify that runtime dependencies are installed correctly and that the application can import its modules and dependencies.
2 parents 39fe784 + d2cb248 commit 39a5dc6

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

.github/workflows/tests.yml

+11
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ jobs:
2929
- name: Set up Python ${{ matrix.python-version }}
3030
run: uv python install ${{ matrix.python-version }}
3131

32+
- name: Test runtime dependencies
33+
run: |
34+
uv run --no-dev -p python${{ matrix.python-version }} -- python -c '
35+
from tmuxp import _internal, cli, workspace, exc, log, plugin, shell, types, util, __version__
36+
from tmuxp._internal import config_reader, types
37+
from tmuxp.workspace import builder, constants, finders, freezer, importers, loader, validation
38+
from libtmux import __version__ as __libtmux_version__
39+
print("tmuxp version:", __version__)
40+
print("libtmux version:", __libtmux_version__)
41+
'
42+
3243
- name: Install dependencies
3344
run: uv sync --all-extras --dev
3445

CHANGES

+5
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force
2121

2222
- _Future release notes will be placed here_
2323

24+
### Bug fixes
25+
26+
- Fix import type unavailable at runtime (#965)
27+
2428
### Development
2529

30+
- CI: Check for runtime dependencies (#965)
2631
- Tests: Improve parametrized test suite (#964)
2732

2833
Convert remaining `pytest.mark.parametrize()` tests to `NamedTuple` fixtures:

src/tmuxp/_internal/types.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@
1212

1313
from __future__ import annotations
1414

15-
from typing_extensions import NotRequired, TypedDict
15+
import typing as t
16+
from typing import TypedDict
17+
18+
if t.TYPE_CHECKING:
19+
import sys
20+
21+
if sys.version_info >= (3, 11):
22+
from typing import NotRequired
23+
else:
24+
from typing_extensions import NotRequired
1625

1726

1827
class PluginConfigSchema(TypedDict):

0 commit comments

Comments
 (0)