ducktools-classbuilder 0.8.2__py3-none-any.whl → 0.8.3__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.
Potentially problematic release.
This version of ducktools-classbuilder might be problematic. Click here for more details.
- ducktools/classbuilder/_version.py +2 -2
- ducktools/classbuilder/annotations.py +12 -45
- {ducktools_classbuilder-0.8.2.dist-info → ducktools_classbuilder-0.8.3.dist-info}/METADATA +1 -1
- {ducktools_classbuilder-0.8.2.dist-info → ducktools_classbuilder-0.8.3.dist-info}/RECORD +7 -7
- {ducktools_classbuilder-0.8.2.dist-info → ducktools_classbuilder-0.8.3.dist-info}/LICENSE +0 -0
- {ducktools_classbuilder-0.8.2.dist-info → ducktools_classbuilder-0.8.3.dist-info}/WHEEL +0 -0
- {ducktools_classbuilder-0.8.2.dist-info → ducktools_classbuilder-0.8.3.dist-info}/top_level.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.8.
|
|
2
|
-
__version_tuple__ = (0, 8,
|
|
1
|
+
__version__ = "0.8.3"
|
|
2
|
+
__version_tuple__ = (0, 8, 3)
|
|
@@ -23,39 +23,12 @@ import sys
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class _LazyAnnotationLib:
|
|
26
|
-
def __init__(self):
|
|
27
|
-
if sys.version_info < (3, 14):
|
|
28
|
-
self.annotationlib_unavailable = True
|
|
29
|
-
else:
|
|
30
|
-
self.annotationlib_unavailable = None
|
|
31
|
-
|
|
32
26
|
def __getattr__(self, item):
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
import annotationlib
|
|
38
|
-
except ImportError:
|
|
39
|
-
self.annotationlib_unavailable = True
|
|
40
|
-
raise ImportError("'annotationlib' is not available")
|
|
41
|
-
else:
|
|
42
|
-
self.Format = annotationlib.Format
|
|
43
|
-
self.call_annotate_function = annotationlib.call_annotate_function
|
|
44
|
-
|
|
45
|
-
# This function keeps getting changed and renamed
|
|
46
|
-
get_ns_annotate = getattr(annotationlib, "get_annotate_from_class_namespace", None)
|
|
47
|
-
if get_ns_annotate is None:
|
|
48
|
-
get_ns_annotate = getattr(annotationlib, "get_annotate_function")
|
|
49
|
-
self.get_ns_annotate = get_ns_annotate
|
|
27
|
+
global _lazyannotationlib
|
|
28
|
+
import annotationlib
|
|
29
|
+
_lazyannotationlib = annotationlib
|
|
30
|
+
return getattr(annotationlib, item)
|
|
50
31
|
|
|
51
|
-
if item == "Format":
|
|
52
|
-
return self.Format
|
|
53
|
-
elif item == "call_annotate_function":
|
|
54
|
-
return self.call_annotate_function
|
|
55
|
-
elif item == "get_ns_annotate":
|
|
56
|
-
return get_ns_annotate
|
|
57
|
-
|
|
58
|
-
raise AttributeError(f"{item!r} is not available from this lazy importer")
|
|
59
32
|
|
|
60
33
|
_lazy_annotationlib = _LazyAnnotationLib()
|
|
61
34
|
|
|
@@ -72,19 +45,14 @@ def get_ns_annotations(ns):
|
|
|
72
45
|
annotations = ns.get("__annotations__")
|
|
73
46
|
if annotations is not None:
|
|
74
47
|
annotations = annotations.copy()
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
annotate
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
annotate,
|
|
84
|
-
format=_lazy_annotationlib.Format.FORWARDREF
|
|
85
|
-
)
|
|
86
|
-
except ImportError:
|
|
87
|
-
pass
|
|
48
|
+
elif sys.version_info >= (3, 14):
|
|
49
|
+
# See if we're using PEP-649 annotations
|
|
50
|
+
annotate = _lazy_annotationlib.get_annotate_from_class_namespace(ns)
|
|
51
|
+
if annotate:
|
|
52
|
+
annotations = _lazy_annotationlib.call_annotate_function(
|
|
53
|
+
annotate,
|
|
54
|
+
format=_lazy_annotationlib.Format.FORWARDREF
|
|
55
|
+
)
|
|
88
56
|
|
|
89
57
|
if annotations is None:
|
|
90
58
|
annotations = {}
|
|
@@ -125,4 +93,3 @@ def is_classvar(hint):
|
|
|
125
93
|
):
|
|
126
94
|
return True
|
|
127
95
|
return False
|
|
128
|
-
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
ducktools/classbuilder/__init__.py,sha256=6rU3erZbq2eNJ8P1zr948J7aHDFqyS8w5b2mKUEKrj8,32731
|
|
2
2
|
ducktools/classbuilder/__init__.pyi,sha256=47rT22Copd8gKiw26sTdAkA99NjMMwX6WsYsN0EEEtY,8060
|
|
3
|
-
ducktools/classbuilder/_version.py,sha256=
|
|
4
|
-
ducktools/classbuilder/annotations.py,sha256=
|
|
3
|
+
ducktools/classbuilder/_version.py,sha256=WeYjLPgnZeDbw78yAtmbCWqzpBXhNlopfXe1KzTtm_c,52
|
|
4
|
+
ducktools/classbuilder/annotations.py,sha256=tFCuVSjnD8VleA7ytQnHo7PrMdlO1EzuTs-zK6tCQyo,3567
|
|
5
5
|
ducktools/classbuilder/annotations.pyi,sha256=c5vYtULdDgMYWtkzeYMsHIbmnEuT2Ru-nNZieWvYuQ4,247
|
|
6
6
|
ducktools/classbuilder/prefab.py,sha256=Lg3gBn3-09036vn5PNvbXt4m8srEo0JP3tf7rxdqk1I,24369
|
|
7
7
|
ducktools/classbuilder/prefab.pyi,sha256=qHK6KvV4C5fky4KCqskpoTUHKD4wCVxTdyGaydrATOE,4582
|
|
8
8
|
ducktools/classbuilder/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
|
|
9
|
-
ducktools_classbuilder-0.8.
|
|
10
|
-
ducktools_classbuilder-0.8.
|
|
11
|
-
ducktools_classbuilder-0.8.
|
|
12
|
-
ducktools_classbuilder-0.8.
|
|
13
|
-
ducktools_classbuilder-0.8.
|
|
9
|
+
ducktools_classbuilder-0.8.3.dist-info/LICENSE,sha256=6Thz9Dbw8R4fWInl6sGl8Rj3UnKnRbDwrc6jZerpugQ,1070
|
|
10
|
+
ducktools_classbuilder-0.8.3.dist-info/METADATA,sha256=4Srcr862qbqjoIY5MpWJoxIK70STNtqqlUVNv0gtp6o,9636
|
|
11
|
+
ducktools_classbuilder-0.8.3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
12
|
+
ducktools_classbuilder-0.8.3.dist-info/top_level.txt,sha256=uSDLtio3ZFqdwcsMJ2O5yhjB4Q3ytbBWbA8rJREganc,10
|
|
13
|
+
ducktools_classbuilder-0.8.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{ducktools_classbuilder-0.8.2.dist-info → ducktools_classbuilder-0.8.3.dist-info}/top_level.txt
RENAMED
|
File without changes
|