wry 0.2.2.dev1__tar.gz → 0.2.3__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.
- {wry-0.2.2.dev1 → wry-0.2.3}/PKG-INFO +1 -1
- {wry-0.2.2.dev1 → wry-0.2.3}/pyproject.toml +1 -1
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/_version.py +2 -2
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/click_integration.py +27 -4
- {wry-0.2.2.dev1 → wry-0.2.3}/LICENSE +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/README.md +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/__init__.py +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/auto_model.py +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/core/__init__.py +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/core/accessors.py +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/core/env_utils.py +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/core/field_utils.py +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/core/model.py +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/core/sources.py +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/multi_model.py +0 -0
- {wry-0.2.2.dev1 → wry-0.2.3}/wry/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "wry"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.3" # Placeholder - actual version comes from git tags via poetry-dynamic-versioning
|
|
4
4
|
description = "Why Repeat Yourself? - Define your CLI once with Pydantic models"
|
|
5
5
|
authors = ["Tyler House <26489166+tahouse@users.noreply.github.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# file generated by poetry-dynamic-versioning
|
|
2
2
|
from typing import TYPE_CHECKING
|
|
3
3
|
|
|
4
|
-
__version__: str = "0.2.
|
|
5
|
-
__version_tuple__: tuple[int, ...] = (0, 2,
|
|
4
|
+
__version__: str = "0.2.3" # This will be replaced during build
|
|
5
|
+
__version_tuple__: tuple[int, ...] = (0, 2, 3) # This will be replaced during build
|
|
6
6
|
__commit_id__: str | None = None # This will be replaced during build
|
|
7
7
|
|
|
8
8
|
# For compatibility with setuptools-scm test expectations
|
|
@@ -518,7 +518,16 @@ def generate_click_parameters(
|
|
|
518
518
|
elif click_parameter:
|
|
519
519
|
# Determine if it's an argument or option
|
|
520
520
|
if hasattr(click_parameter, "__name__") and "argument" in str(click_parameter):
|
|
521
|
-
|
|
521
|
+
modified_arg, arg_info = extract_and_modify_argument_decorator(click_parameter)
|
|
522
|
+
arguments.append(modified_arg)
|
|
523
|
+
|
|
524
|
+
# Track argument description for docstring injection
|
|
525
|
+
# Try to get help from decorator first, then from Field description
|
|
526
|
+
help_text = arg_info.get("help") or field_info.description
|
|
527
|
+
if help_text:
|
|
528
|
+
# Use the argument name from param_decls, uppercase it for display
|
|
529
|
+
arg_name = arg_info.get("param_decls", [field_name])[0].upper()
|
|
530
|
+
argument_docs.append((arg_name, help_text))
|
|
522
531
|
else:
|
|
523
532
|
# Only append if it's actually a Click decorator, not an AutoClickParameter
|
|
524
533
|
if callable(click_parameter) and not isinstance(click_parameter, AutoClickParameter):
|
|
@@ -613,8 +622,15 @@ def generate_click_parameters(
|
|
|
613
622
|
|
|
614
623
|
def extract_and_modify_argument_decorator(
|
|
615
624
|
click_decorator: ClickParameterDecorator[Any],
|
|
616
|
-
) -> ClickParameterDecorator[Any]:
|
|
617
|
-
"""Extract and modify a click.argument decorator to set required=False.
|
|
625
|
+
) -> tuple[ClickParameterDecorator[Any], dict[str, Any]]:
|
|
626
|
+
"""Extract and modify a click.argument decorator to set required=False.
|
|
627
|
+
|
|
628
|
+
Returns:
|
|
629
|
+
Tuple of (modified_decorator, info_dict) where info_dict contains:
|
|
630
|
+
- param_decls: list of parameter declaration strings
|
|
631
|
+
- help: help text if available
|
|
632
|
+
- other attributes from the original decorator
|
|
633
|
+
"""
|
|
618
634
|
# Default values - use a safe fallback
|
|
619
635
|
param_decls: list[str] = ["argument"]
|
|
620
636
|
attrs: dict[str, Any] = {"required": False}
|
|
@@ -655,8 +671,15 @@ def extract_and_modify_argument_decorator(
|
|
|
655
671
|
# If closure inspection fails, just use defaults
|
|
656
672
|
pass
|
|
657
673
|
|
|
674
|
+
# Create info dict with extracted information (including help if present)
|
|
675
|
+
info = {"param_decls": param_decls, **attrs}
|
|
676
|
+
|
|
677
|
+
# Remove 'help' from attrs before creating Click argument
|
|
678
|
+
# (click.Argument doesn't accept 'help' parameter)
|
|
679
|
+
argument_attrs = {k: v for k, v in attrs.items() if k != "help"}
|
|
680
|
+
|
|
658
681
|
# Create new argument with modified attrs
|
|
659
|
-
return click.argument(*param_decls, **
|
|
682
|
+
return click.argument(*param_decls, **argument_attrs), info
|
|
660
683
|
|
|
661
684
|
|
|
662
685
|
def build_config_with_sources(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|