yaafcli 2026.2.4.180929__py3-none-any.whl → 2026.2.5.15101__py3-none-any.whl
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.
- yaaf/di.py +15 -2
- {yaafcli-2026.2.4.180929.dist-info → yaafcli-2026.2.5.15101.dist-info}/METADATA +1 -1
- {yaafcli-2026.2.4.180929.dist-info → yaafcli-2026.2.5.15101.dist-info}/RECORD +7 -7
- {yaafcli-2026.2.4.180929.dist-info → yaafcli-2026.2.5.15101.dist-info}/WHEEL +0 -0
- {yaafcli-2026.2.4.180929.dist-info → yaafcli-2026.2.5.15101.dist-info}/entry_points.txt +0 -0
- {yaafcli-2026.2.4.180929.dist-info → yaafcli-2026.2.5.15101.dist-info}/licenses/LICENSE +0 -0
- {yaafcli-2026.2.4.180929.dist-info → yaafcli-2026.2.5.15101.dist-info}/top_level.txt +0 -0
yaaf/di.py
CHANGED
|
@@ -29,9 +29,22 @@ class ServiceRegistry:
|
|
|
29
29
|
"""Resolve a service by type annotation."""
|
|
30
30
|
if isinstance(annotation, str):
|
|
31
31
|
return self.by_alias.get(annotation)
|
|
32
|
-
if annotation and annotation in self.by_type:
|
|
33
|
-
return self.by_type[annotation]
|
|
34
32
|
if annotation is not None:
|
|
33
|
+
# Direct type match
|
|
34
|
+
if annotation in self.by_type:
|
|
35
|
+
return self.by_type[annotation]
|
|
36
|
+
|
|
37
|
+
# Check for protocol/base class relationships
|
|
38
|
+
for registered_type, instance in self.by_type.items():
|
|
39
|
+
try:
|
|
40
|
+
# Check if registered type is a subclass of the annotation
|
|
41
|
+
if issubclass(registered_type, annotation):
|
|
42
|
+
return instance
|
|
43
|
+
except (TypeError, AttributeError):
|
|
44
|
+
# Handle cases where issubclass fails (e.g., for Protocol types)
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
# Try to resolve by name as fallback
|
|
35
48
|
alias = getattr(annotation, "__name__", "")
|
|
36
49
|
if alias and alias in self.by_alias:
|
|
37
50
|
return self.by_alias[alias]
|
|
@@ -2,15 +2,15 @@ yaaf/__init__.py,sha256=mH1F6chTA4kRIaYK-yA1E7pBMOyReKi3rbrMiqKTxUY,602
|
|
|
2
2
|
yaaf/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
|
|
3
3
|
yaaf/app.py,sha256=7YrPl2_OZ-8NUy1RvUEBAbSntcqlP_in-2TLrKmGooE,3339
|
|
4
4
|
yaaf/cli.py,sha256=X8YmeozhWjNtbEiyg_wTK75f_d-5LPKYkQmkU6v8dm0,1672
|
|
5
|
-
yaaf/di.py,sha256=
|
|
5
|
+
yaaf/di.py,sha256=yoyTuL0Vc4MmGj_71M04JpLAzqBRREniZk1f2opEuEE,3039
|
|
6
6
|
yaaf/gen_services.py,sha256=Gov7IlSLMG5Oo8RoRGHCbxHSsb_qecoh7IBZPWZKEe8,2869
|
|
7
7
|
yaaf/loader.py,sha256=OzN2J5xl_sWGyNEaPz2LcuSEGfRPWHAGAs7QoK2JUdY,7215
|
|
8
8
|
yaaf/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
yaaf/responses.py,sha256=iXZ0vDYfGO-BEUBBsobCR4JfWLRx8zhwYD9taQ8Sat4,2616
|
|
10
10
|
yaaf/types.py,sha256=BAD3Wkjqi4NKxNz2bT1xggPx0jU5Sz_hOvsHXmGszig,1262
|
|
11
|
-
yaafcli-2026.2.
|
|
12
|
-
yaafcli-2026.2.
|
|
13
|
-
yaafcli-2026.2.
|
|
14
|
-
yaafcli-2026.2.
|
|
15
|
-
yaafcli-2026.2.
|
|
16
|
-
yaafcli-2026.2.
|
|
11
|
+
yaafcli-2026.2.5.15101.dist-info/licenses/LICENSE,sha256=ESYyLizI0WWtxMeS7rGVcX3ivMezm-HOd5WdeOh-9oU,1056
|
|
12
|
+
yaafcli-2026.2.5.15101.dist-info/METADATA,sha256=ZRaPfbW4yBgyaCqm1NjLSELdwWsq461qz26BHwcGWAA,6247
|
|
13
|
+
yaafcli-2026.2.5.15101.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
14
|
+
yaafcli-2026.2.5.15101.dist-info/entry_points.txt,sha256=dh9ijq3gnFIr46RFjPjGR48PHQMUxwHopj3b9JipCRQ,39
|
|
15
|
+
yaafcli-2026.2.5.15101.dist-info/top_level.txt,sha256=6WqEmcTdZROTeK4-7HzkB5h9JMBgs51otonH6vnjcAc,5
|
|
16
|
+
yaafcli-2026.2.5.15101.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|