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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.1.30] - 2026-07-30

### Fixed

- Keep `Annotated` validation metadata available to form construction while
presenting the compact owning type in parameter help.

## [0.1.29] - 2026-07-30

### Changed
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
copyright = "2024, Tristan Simas"
author = "Tristan Simas"
version = "0.1"
release = "0.1.29"
release = "0.1.30"

# General configuration
extensions = [
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "pyqt-reactive"
version = "0.1.29"
version = "0.1.30"
description = "React-quality reactive form generation framework for PyQt6"
authors = [{name = "Tristan Simas", email = "tristan.simas@mail.mcgill.ca"}]
license = {text = "MIT"}
Expand Down
2 changes: 1 addition & 1 deletion src/pyqt_reactive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- Cross-window reactive updates
"""

__version__ = "0.1.29"
__version__ = "0.1.30"

# Public API will be populated as modules are added
__all__ = [
Expand Down
14 changes: 10 additions & 4 deletions src/pyqt_reactive/services/parameter_help_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
from typing import Annotated, Callable, Optional, Union, get_args, get_origin

from objectstate.lazy_factory import get_base_type_for_lazy, is_lazy_dataclass
from python_introspect import DocstringExtractor, DocstringInfo, UnifiedParameterAnalyzer
from python_introspect import (
DocstringExtractor,
DocstringInfo,
UnifiedParameterAnalyzer,
resolve_annotated,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -310,9 +315,10 @@ def parameter_type_display(param_type: type | None) -> str:
"""Return the compact type label used by parameter help."""
if param_type is None:
return ""
if isinstance(param_type, type):
return f" ({param_type.__name__})"
return f" ({param_type})"
display_type = resolve_annotated(param_type)
if isinstance(display_type, type):
return f" ({display_type.__name__})"
return f" ({display_type})"


def split_default_prefix(text: str) -> tuple[str, str]:
Expand Down
14 changes: 14 additions & 0 deletions tests/test_parameter_help_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Tests for shared parameter help introspection."""

from dataclasses import dataclass
from typing import Annotated

from pyqt_reactive.services.parameter_help_service import parameter_help_content


def test_dataclass_docstring_help_falls_back_when_source_is_unavailable(monkeypatch):
Expand All @@ -26,3 +29,14 @@ def raise_source_unavailable(_target):

assert docstring_info.summary == "Generated-like config summary."
assert docstring_info.description is None


def test_parameter_help_projects_annotated_owner_type_without_metadata_repr() -> None:
content = parameter_help_content(
param_name="colormap",
param_type=Annotated[str, "non-empty"],
description="Napari colormap name.",
)

assert content.summary == "• colormap (str)"
assert content.description == "Napari colormap name."
Loading