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.
Files changed (27) hide show
  1. {python_introspect-0.1.7/src/python_introspect.egg-info → python_introspect-0.1.8}/PKG-INFO +1 -1
  2. {python_introspect-0.1.7 → python_introspect-0.1.8}/pyproject.toml +1 -1
  3. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/__init__.py +1 -1
  4. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/signature_analyzer.py +1 -1
  5. {python_introspect-0.1.7 → python_introspect-0.1.8/src/python_introspect.egg-info}/PKG-INFO +1 -1
  6. {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_init.py +1 -1
  7. {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_signature_analyzer.py +13 -1
  8. {python_introspect-0.1.7 → python_introspect-0.1.8}/LICENSE +0 -0
  9. {python_introspect-0.1.7 → python_introspect-0.1.8}/README.md +0 -0
  10. {python_introspect-0.1.7 → python_introspect-0.1.8}/setup.cfg +0 -0
  11. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/annotation_types.py +0 -0
  12. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/dataclass_projection.py +0 -0
  13. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/enableable.py +0 -0
  14. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/environment_projection.py +0 -0
  15. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/exceptions.py +0 -0
  16. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/unified_parameter_analyzer.py +0 -0
  17. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect/validation.py +0 -0
  18. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/SOURCES.txt +0 -0
  19. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/dependency_links.txt +0 -0
  20. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/requires.txt +0 -0
  21. {python_introspect-0.1.7 → python_introspect-0.1.8}/src/python_introspect.egg-info/top_level.txt +0 -0
  22. {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_annotation_types.py +0 -0
  23. {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_dataclass_projection.py +0 -0
  24. {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_environment_projection.py +0 -0
  25. {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_exceptions.py +0 -0
  26. {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_unified_parameter_analyzer.py +0 -0
  27. {python_introspect-0.1.7 → python_introspect-0.1.8}/tests/test_validation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-introspect
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: Pure Python introspection toolkit for function signatures, dataclasses, and type hints
5
5
  Author-email: Tristan Simas <tristan.simas@mail.mcgill.ca>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-introspect"
7
- version = "0.1.7"
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"
@@ -9,7 +9,7 @@ Extensibility:
9
9
  type resolution for framework-specific types (lazy configs, proxies, etc.)
10
10
  """
11
11
 
12
- __version__ = "0.1.7"
12
+ __version__ = "0.1.8"
13
13
 
14
14
  from .signature_analyzer import (
15
15
  SignatureAnalyzer,
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-introspect
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: Pure Python introspection toolkit for function signatures, dataclasses, and type hints
5
5
  Author-email: Tristan Simas <tristan.simas@mail.mcgill.ca>
6
6
  License: MIT
@@ -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.7"
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