File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 11import json
2+ from typing import Any
3+ from typing import TypeGuard
24
35import click
46from httpx import Client
7+ from pydantic import BaseModel
58from scim2_client .engines .httpx import SyncSCIMClient
69from scim2_models import Group
710from scim2_models import User
1619from scim2_cli .utils import DOC_URL
1720
1821
22+ # monkeypatching pydanclick until this patch is released
23+ # https://github.com/felix-martel/pydanclick/pull/25
24+ def patch_pydanclick ():
25+ def _is_pydantic_model (model : Any ) -> TypeGuard [type [BaseModel ]]:
26+ """Return True if `model` is a Pydantic `BaseModel` class."""
27+ try :
28+ return issubclass (model , BaseModel )
29+ except TypeError :
30+ return False
31+
32+ import pydanclick .model .field_collection
33+
34+ pydanclick .model .field_collection ._is_pydantic_model = _is_pydantic_model
35+
36+
37+ patch_pydanclick ()
38+
39+
1940@click .group (cls = make_rst_to_ansi_formatter (DOC_URL , group = True ))
2041@click .argument ("url" )
2142@click .pass_context
You can’t perform that action at this time.
0 commit comments