python-introspect 0.1.7__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_introspect-0.1.7/src/python_introspect.egg-info → python_introspect-0.1.8}/PKG-INFO +1 -1
- {python_introspect-0.1.7 → python_introspect-0.1.8}/pyproject.toml +1 -1
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/__init__.py +1 -1
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/signature_analyzer.py +1 -1
- {python_introspect-0.1.7 → python_introspect-0.1.8/src/python_introspect.egg-info}/PKG-INFO +1 -1
- {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_init.py +1 -1
- {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_signature_analyzer.py +13 -1
- {python_introspect-0.1.7 → python_introspect-0.1.8}/LICENSE +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/README.md +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/setup.cfg +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/annotation_types.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/dataclass_projection.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/enableable.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/environment_projection.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/exceptions.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/unified_parameter_analyzer.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/validation.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/SOURCES.txt +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/dependency_links.txt +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/requires.txt +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/top_level.txt +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_annotation_types.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_dataclass_projection.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_environment_projection.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_exceptions.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_unified_parameter_analyzer.py +0 -0
- {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_validation.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-introspect"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.8"
|
|
8
8
|
description = "Pure Python introspection toolkit for function signatures, dataclasses, and type hints"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
{python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/signature_analyzer.py
RENAMED
|
@@ -936,7 +936,7 @@ class SignatureAnalyzer:
|
|
|
936
936
|
try:
|
|
937
937
|
# Try to get type hints, fall back to __annotations__ if resolution fails
|
|
938
938
|
try:
|
|
939
|
-
type_hints = get_type_hints(dataclass_type)
|
|
939
|
+
type_hints = get_type_hints(dataclass_type, include_extras=True)
|
|
940
940
|
except Exception:
|
|
941
941
|
type_hints = inspect.get_annotations(dataclass_type, eval_str=False)
|
|
942
942
|
|
|
@@ -11,7 +11,7 @@ class TestPackageImports:
|
|
|
11
11
|
"""Test that __version__ is available."""
|
|
12
12
|
assert hasattr(python_introspect, "__version__")
|
|
13
13
|
assert isinstance(python_introspect.__version__, str)
|
|
14
|
-
assert python_introspect.__version__ == "0.1.
|
|
14
|
+
assert python_introspect.__version__ == "0.1.8"
|
|
15
15
|
|
|
16
16
|
def test_signature_analyzer_import(self):
|
|
17
17
|
"""Test SignatureAnalyzer is importable."""
|
|
@@ -5,7 +5,7 @@ from dataclasses import dataclass, field
|
|
|
5
5
|
from enum import Enum
|
|
6
6
|
from functools import wraps
|
|
7
7
|
from typing import get_args
|
|
8
|
-
from typing import Optional, List, Dict, Any
|
|
8
|
+
from typing import Annotated, Optional, List, Dict, Any
|
|
9
9
|
from python_introspect import (
|
|
10
10
|
SignatureAnalyzer,
|
|
11
11
|
ParameterInfo,
|
|
@@ -163,6 +163,18 @@ class TestSignatureAnalyzer:
|
|
|
163
163
|
assert params["settings"].default_value == {}
|
|
164
164
|
assert params["items"].is_required is False
|
|
165
165
|
|
|
166
|
+
def test_analyze_dataclass_preserves_annotated_metadata(self):
|
|
167
|
+
"""Dataclass analysis retains metadata used by downstream projections."""
|
|
168
|
+
marker = object()
|
|
169
|
+
|
|
170
|
+
@dataclass
|
|
171
|
+
class Config:
|
|
172
|
+
shortcut: Annotated[str, marker] = "Ctrl+P"
|
|
173
|
+
|
|
174
|
+
params = SignatureAnalyzer.analyze(Config)
|
|
175
|
+
|
|
176
|
+
assert params["shortcut"].param_type == Annotated[str, marker]
|
|
177
|
+
|
|
166
178
|
def test_field_type_docs_use_resolved_forward_annotations(self):
|
|
167
179
|
docs = SignatureAnalyzer._extract_field_type_docs(
|
|
168
180
|
ForwardFieldDocumentationOwner
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/annotation_types.py
RENAMED
|
File without changes
|
{python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/dataclass_projection.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/environment_projection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_unified_parameter_analyzer.py
RENAMED
|
File without changes
|
|
File without changes
|