diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 67e57b26de..75006152f2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,6 +29,17 @@ jobs: - name: Set up Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} + - name: Test runtime dependencies + run: | + uv run --no-dev -p python${{ matrix.python-version }} -- 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__) + ' + - name: Install dependencies run: uv sync --all-extras --dev diff --git a/CHANGES b/CHANGES index b0c485a056..fd4d555575 100644 --- a/CHANGES +++ b/CHANGES @@ -21,8 +21,13 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force - _Future release notes will be placed here_ +### Bug fixes + +- Fix import type unavailable at runtime (#965) + ### Development +- CI: Check for runtime dependencies (#965) - Tests: Improve parametrized test suite (#964) Convert remaining `pytest.mark.parametrize()` tests to `NamedTuple` fixtures: diff --git a/src/tmuxp/_internal/types.py b/src/tmuxp/_internal/types.py index c66d88956c..a3521f5832 100644 --- a/src/tmuxp/_internal/types.py +++ b/src/tmuxp/_internal/types.py @@ -12,7 +12,16 @@ from __future__ import annotations -from typing_extensions import NotRequired, TypedDict +import typing as t +from typing import TypedDict + +if t.TYPE_CHECKING: + import sys + + if sys.version_info >= (3, 11): + from typing import NotRequired + else: + from typing_extensions import NotRequired class PluginConfigSchema(TypedDict):