@alloy-js/python 0.4.0-dev.2 → 0.4.0-dev.5

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 (258) hide show
  1. package/dist/dev/src/builtins/python.js +30 -0
  2. package/dist/dev/src/builtins/python.js.map +1 -0
  3. package/dist/dev/src/components/Atom.js +122 -0
  4. package/dist/dev/src/components/Atom.js.map +1 -0
  5. package/dist/dev/src/components/CallSignature.js +195 -0
  6. package/dist/dev/src/components/CallSignature.js.map +1 -0
  7. package/dist/dev/src/components/ClassDeclaration.js +112 -0
  8. package/dist/dev/src/components/ClassDeclaration.js.map +1 -0
  9. package/dist/dev/src/components/ClassInstantiation.js +40 -0
  10. package/dist/dev/src/components/ClassInstantiation.js.map +1 -0
  11. package/dist/dev/src/components/ClassMethodDeclaration.js +40 -0
  12. package/dist/dev/src/components/ClassMethodDeclaration.js.map +1 -0
  13. package/dist/dev/src/components/ConstructorDeclaration.js +39 -0
  14. package/dist/dev/src/components/ConstructorDeclaration.js.map +1 -0
  15. package/dist/dev/src/components/DataclassDeclaration.js +177 -0
  16. package/dist/dev/src/components/DataclassDeclaration.js.map +1 -0
  17. package/dist/dev/src/components/Declaration.js +31 -0
  18. package/dist/dev/src/components/Declaration.js.map +1 -0
  19. package/dist/dev/src/components/DunderMethodDeclaration.js +33 -0
  20. package/dist/dev/src/components/DunderMethodDeclaration.js.map +1 -0
  21. package/dist/dev/src/components/EnumDeclaration.js +259 -0
  22. package/dist/dev/src/components/EnumDeclaration.js.map +1 -0
  23. package/dist/dev/src/components/EnumMember.js +95 -0
  24. package/dist/dev/src/components/EnumMember.js.map +1 -0
  25. package/dist/dev/src/components/FunctionBase.js +130 -0
  26. package/dist/dev/src/components/FunctionBase.js.map +1 -0
  27. package/dist/dev/src/components/FunctionCallExpression.js +53 -0
  28. package/dist/dev/src/components/FunctionCallExpression.js.map +1 -0
  29. package/dist/dev/src/components/FunctionDeclaration.js +45 -0
  30. package/dist/dev/src/components/FunctionDeclaration.js.map +1 -0
  31. package/dist/dev/src/components/FutureStatement.js +31 -0
  32. package/dist/dev/src/components/FutureStatement.js.map +1 -0
  33. package/dist/dev/src/components/ImportStatement.js +167 -0
  34. package/dist/dev/src/components/ImportStatement.js.map +1 -0
  35. package/dist/dev/src/components/LexicalScope.js +26 -0
  36. package/dist/dev/src/components/LexicalScope.js.map +1 -0
  37. package/dist/dev/src/components/MemberExpression.js +290 -0
  38. package/dist/dev/src/components/MemberExpression.js.map +1 -0
  39. package/dist/dev/src/components/MemberScope.js +23 -0
  40. package/dist/dev/src/components/MemberScope.js.map +1 -0
  41. package/dist/dev/src/components/MethodBase.js +40 -0
  42. package/dist/dev/src/components/MethodBase.js.map +1 -0
  43. package/dist/dev/src/components/MethodDeclaration.js +38 -0
  44. package/dist/dev/src/components/MethodDeclaration.js.map +1 -0
  45. package/dist/dev/src/components/PropertyDeclaration.js +287 -0
  46. package/dist/dev/src/components/PropertyDeclaration.js.map +1 -0
  47. package/dist/dev/src/components/PyDoc.js +1478 -0
  48. package/dist/dev/src/components/PyDoc.js.map +1 -0
  49. package/dist/dev/src/components/PythonBlock.js +35 -0
  50. package/dist/dev/src/components/PythonBlock.js.map +1 -0
  51. package/dist/dev/src/components/Reference.js +23 -0
  52. package/dist/dev/src/components/Reference.js.map +1 -0
  53. package/dist/dev/src/components/SourceFile.js +385 -0
  54. package/dist/dev/src/components/SourceFile.js.map +1 -0
  55. package/dist/dev/src/components/StatementList.js +34 -0
  56. package/dist/dev/src/components/StatementList.js.map +1 -0
  57. package/dist/dev/src/components/StaticMethodDeclaration.js +40 -0
  58. package/dist/dev/src/components/StaticMethodDeclaration.js.map +1 -0
  59. package/dist/dev/src/components/TypeArguments.js +22 -0
  60. package/dist/dev/src/components/TypeArguments.js.map +1 -0
  61. package/dist/dev/src/components/TypeRefContext.js +33 -0
  62. package/dist/dev/src/components/TypeRefContext.js.map +1 -0
  63. package/dist/dev/src/components/TypeReference.js +67 -0
  64. package/dist/dev/src/components/TypeReference.js.map +1 -0
  65. package/dist/dev/src/components/UnionTypeExpression.js +57 -0
  66. package/dist/dev/src/components/UnionTypeExpression.js.map +1 -0
  67. package/dist/dev/src/components/VariableDeclaration.js +150 -0
  68. package/dist/dev/src/components/VariableDeclaration.js.map +1 -0
  69. package/dist/dev/src/components/index.js +32 -0
  70. package/dist/dev/src/components/index.js.map +1 -0
  71. package/dist/dev/src/context/index.js +2 -0
  72. package/dist/dev/src/context/index.js.map +1 -0
  73. package/dist/dev/src/context/type-ref-context.js +17 -0
  74. package/dist/dev/src/context/type-ref-context.js.map +1 -0
  75. package/dist/dev/src/create-module.js +64 -0
  76. package/dist/dev/src/create-module.js.map +1 -0
  77. package/dist/dev/src/index.js +8 -0
  78. package/dist/dev/src/index.js.map +1 -0
  79. package/dist/dev/src/name-conflict-resolver.js +8 -0
  80. package/dist/dev/src/name-conflict-resolver.js.map +1 -0
  81. package/dist/dev/src/name-policy.js +48 -0
  82. package/dist/dev/src/name-policy.js.map +1 -0
  83. package/dist/dev/src/parameter-descriptor.js +8 -0
  84. package/dist/dev/src/parameter-descriptor.js.map +1 -0
  85. package/dist/dev/src/symbol-creation.js +58 -0
  86. package/dist/dev/src/symbol-creation.js.map +1 -0
  87. package/dist/dev/src/symbols/factories.js +28 -0
  88. package/dist/dev/src/symbols/factories.js.map +1 -0
  89. package/dist/dev/src/symbols/index.js +8 -0
  90. package/dist/dev/src/symbols/index.js.map +1 -0
  91. package/dist/dev/src/symbols/python-lexical-scope.js +15 -0
  92. package/dist/dev/src/symbols/python-lexical-scope.js.map +1 -0
  93. package/dist/dev/src/symbols/python-member-scope.js +7 -0
  94. package/dist/dev/src/symbols/python-member-scope.js.map +1 -0
  95. package/dist/dev/src/symbols/python-module-scope.js +86 -0
  96. package/dist/dev/src/symbols/python-module-scope.js.map +1 -0
  97. package/dist/dev/src/symbols/python-output-symbol.js +73 -0
  98. package/dist/dev/src/symbols/python-output-symbol.js.map +1 -0
  99. package/dist/dev/src/symbols/reference.js +87 -0
  100. package/dist/dev/src/symbols/reference.js.map +1 -0
  101. package/dist/dev/src/symbols/scopes.js +13 -0
  102. package/dist/dev/src/symbols/scopes.js.map +1 -0
  103. package/dist/dev/src/utils.js +13 -0
  104. package/dist/dev/src/utils.js.map +1 -0
  105. package/dist/dev/test/callsignatures.test.js +482 -0
  106. package/dist/dev/test/callsignatures.test.js.map +1 -0
  107. package/dist/dev/test/class-method-declaration.test.js +85 -0
  108. package/dist/dev/test/class-method-declaration.test.js.map +1 -0
  109. package/dist/dev/test/classdeclarations.test.js +654 -0
  110. package/dist/dev/test/classdeclarations.test.js.map +1 -0
  111. package/dist/dev/test/classinstantiations.test.js +281 -0
  112. package/dist/dev/test/classinstantiations.test.js.map +1 -0
  113. package/dist/dev/test/constructordeclaration.test.js +86 -0
  114. package/dist/dev/test/constructordeclaration.test.js.map +1 -0
  115. package/dist/dev/test/dataclassdeclarations.test.js +1068 -0
  116. package/dist/dev/test/dataclassdeclarations.test.js.map +1 -0
  117. package/dist/dev/test/dundermethoddeclaration.test.js +93 -0
  118. package/dist/dev/test/dundermethoddeclaration.test.js.map +1 -0
  119. package/dist/dev/test/enums.test.js +263 -0
  120. package/dist/dev/test/enums.test.js.map +1 -0
  121. package/dist/dev/test/externals.test.js +307 -0
  122. package/dist/dev/test/externals.test.js.map +1 -0
  123. package/dist/dev/test/factories.test.js +122 -0
  124. package/dist/dev/test/factories.test.js.map +1 -0
  125. package/dist/dev/test/functioncallexpressions.test.js +257 -0
  126. package/dist/dev/test/functioncallexpressions.test.js.map +1 -0
  127. package/dist/dev/test/functiondeclaration.test.js +817 -0
  128. package/dist/dev/test/functiondeclaration.test.js.map +1 -0
  129. package/dist/dev/test/imports.test.js +372 -0
  130. package/dist/dev/test/imports.test.js.map +1 -0
  131. package/dist/dev/test/memberexpressions.test.js +1668 -0
  132. package/dist/dev/test/memberexpressions.test.js.map +1 -0
  133. package/dist/dev/test/methoddeclaration.test.js +344 -0
  134. package/dist/dev/test/methoddeclaration.test.js.map +1 -0
  135. package/dist/dev/test/namepolicies.test.js +154 -0
  136. package/dist/dev/test/namepolicies.test.js.map +1 -0
  137. package/dist/dev/test/propertydeclaration.test.js +354 -0
  138. package/dist/dev/test/propertydeclaration.test.js.map +1 -0
  139. package/dist/dev/test/pydocs.test.js +1675 -0
  140. package/dist/dev/test/pydocs.test.js.map +1 -0
  141. package/dist/dev/test/references.test.js +66 -0
  142. package/dist/dev/test/references.test.js.map +1 -0
  143. package/dist/dev/test/sourcefiles.test.js +1802 -0
  144. package/dist/dev/test/sourcefiles.test.js.map +1 -0
  145. package/dist/dev/test/staticmethoddeclaration.test.js +85 -0
  146. package/dist/dev/test/staticmethoddeclaration.test.js.map +1 -0
  147. package/dist/dev/test/type-checking-imports.test.js +617 -0
  148. package/dist/dev/test/type-checking-imports.test.js.map +1 -0
  149. package/dist/dev/test/typereference.test.js +79 -0
  150. package/dist/dev/test/typereference.test.js.map +1 -0
  151. package/dist/dev/test/uniontypeexpression.test.js +307 -0
  152. package/dist/dev/test/uniontypeexpression.test.js.map +1 -0
  153. package/dist/dev/test/utils.js +100 -0
  154. package/dist/dev/test/utils.js.map +1 -0
  155. package/dist/dev/test/values.test.js +182 -0
  156. package/dist/dev/test/values.test.js.map +1 -0
  157. package/dist/dev/test/variables.test.js +363 -0
  158. package/dist/dev/test/variables.test.js.map +1 -0
  159. package/dist/src/components/CallSignature.d.ts.map +1 -1
  160. package/dist/src/components/CallSignature.js +12 -3
  161. package/dist/src/components/CallSignature.js.map +1 -1
  162. package/dist/src/components/ImportStatement.d.ts +12 -0
  163. package/dist/src/components/ImportStatement.d.ts.map +1 -1
  164. package/dist/src/components/ImportStatement.js +47 -5
  165. package/dist/src/components/ImportStatement.js.map +1 -1
  166. package/dist/src/components/MemberExpression.d.ts +1 -1
  167. package/dist/src/components/MemberExpression.d.ts.map +1 -1
  168. package/dist/src/components/MemberExpression.js +98 -180
  169. package/dist/src/components/MemberExpression.js.map +1 -1
  170. package/dist/src/components/Reference.d.ts.map +1 -1
  171. package/dist/src/components/Reference.js +5 -1
  172. package/dist/src/components/Reference.js.map +1 -1
  173. package/dist/src/components/SourceFile.d.ts +1 -1
  174. package/dist/src/components/SourceFile.d.ts.map +1 -1
  175. package/dist/src/components/SourceFile.js +46 -7
  176. package/dist/src/components/SourceFile.js.map +1 -1
  177. package/dist/src/components/TypeRefContext.d.ts +26 -0
  178. package/dist/src/components/TypeRefContext.d.ts.map +1 -0
  179. package/dist/src/components/TypeRefContext.js +29 -0
  180. package/dist/src/components/TypeRefContext.js.map +1 -0
  181. package/dist/src/components/TypeReference.d.ts +5 -0
  182. package/dist/src/components/TypeReference.d.ts.map +1 -1
  183. package/dist/src/components/TypeReference.js +19 -9
  184. package/dist/src/components/TypeReference.js.map +1 -1
  185. package/dist/src/components/VariableDeclaration.d.ts.map +1 -1
  186. package/dist/src/components/VariableDeclaration.js +7 -2
  187. package/dist/src/components/VariableDeclaration.js.map +1 -1
  188. package/dist/src/components/index.d.ts +1 -1
  189. package/dist/src/components/index.d.ts.map +1 -1
  190. package/dist/src/components/index.js +1 -1
  191. package/dist/src/components/index.js.map +1 -1
  192. package/dist/src/context/index.d.ts +2 -0
  193. package/dist/src/context/index.d.ts.map +1 -0
  194. package/dist/src/context/index.js +2 -0
  195. package/dist/src/context/index.js.map +1 -0
  196. package/dist/src/context/type-ref-context.d.ts +13 -0
  197. package/dist/src/context/type-ref-context.d.ts.map +1 -0
  198. package/dist/src/context/type-ref-context.js +17 -0
  199. package/dist/src/context/type-ref-context.js.map +1 -0
  200. package/dist/src/symbols/python-module-scope.d.ts +13 -1
  201. package/dist/src/symbols/python-module-scope.d.ts.map +1 -1
  202. package/dist/src/symbols/python-module-scope.js +36 -2
  203. package/dist/src/symbols/python-module-scope.js.map +1 -1
  204. package/dist/src/symbols/python-output-symbol.d.ts +11 -0
  205. package/dist/src/symbols/python-output-symbol.d.ts.map +1 -1
  206. package/dist/src/symbols/python-output-symbol.js +26 -2
  207. package/dist/src/symbols/python-output-symbol.js.map +1 -1
  208. package/dist/src/symbols/reference.d.ts +8 -1
  209. package/dist/src/symbols/reference.d.ts.map +1 -1
  210. package/dist/src/symbols/reference.js +4 -2
  211. package/dist/src/symbols/reference.js.map +1 -1
  212. package/dist/test/dataclassdeclarations.test.js +5 -2
  213. package/dist/test/dataclassdeclarations.test.js.map +1 -1
  214. package/dist/test/externals.test.js +8 -2
  215. package/dist/test/externals.test.js.map +1 -1
  216. package/dist/test/functiondeclaration.test.js +6 -3
  217. package/dist/test/functiondeclaration.test.js.map +1 -1
  218. package/dist/test/imports.test.js +3 -3
  219. package/dist/test/imports.test.js.map +1 -1
  220. package/dist/test/references.test.js +1 -1
  221. package/dist/test/references.test.js.map +1 -1
  222. package/dist/test/sourcefiles.test.js +26 -26
  223. package/dist/test/sourcefiles.test.js.map +1 -1
  224. package/dist/test/type-checking-imports.test.d.ts +2 -0
  225. package/dist/test/type-checking-imports.test.d.ts.map +1 -0
  226. package/dist/test/type-checking-imports.test.js +437 -0
  227. package/dist/test/type-checking-imports.test.js.map +1 -0
  228. package/dist/test/uniontypeexpression.test.js +4 -1
  229. package/dist/test/uniontypeexpression.test.js.map +1 -1
  230. package/dist/test/variables.test.js +4 -1
  231. package/dist/test/variables.test.js.map +1 -1
  232. package/dist/tsconfig.tsbuildinfo +1 -1
  233. package/package.json +6 -4
  234. package/src/components/CallSignature.tsx +6 -2
  235. package/src/components/ImportStatement.tsx +52 -5
  236. package/src/components/MemberExpression.tsx +174 -298
  237. package/src/components/Reference.tsx +3 -1
  238. package/src/components/SourceFile.tsx +44 -8
  239. package/src/components/TypeRefContext.tsx +36 -0
  240. package/src/components/TypeReference.tsx +15 -7
  241. package/src/components/VariableDeclaration.tsx +5 -1
  242. package/src/components/index.ts +1 -1
  243. package/src/context/index.ts +1 -0
  244. package/src/context/type-ref-context.tsx +16 -0
  245. package/src/symbols/python-module-scope.ts +55 -2
  246. package/src/symbols/python-output-symbol.ts +32 -1
  247. package/src/symbols/reference.tsx +10 -0
  248. package/temp/api.json +443 -338
  249. package/test/dataclassdeclarations.test.tsx +8 -2
  250. package/test/externals.test.tsx +8 -2
  251. package/test/functiondeclaration.test.tsx +6 -3
  252. package/test/imports.test.tsx +6 -6
  253. package/test/references.test.tsx +1 -1
  254. package/test/sourcefiles.test.tsx +13 -13
  255. package/test/type-checking-imports.test.tsx +363 -0
  256. package/test/uniontypeexpression.test.tsx +4 -1
  257. package/test/variables.test.tsx +4 -1
  258. package/vitest.config.ts +8 -0
@@ -0,0 +1,617 @@
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
+ import { refkey } from "@alloy-js/core";
3
+ import { describe, it } from "vitest";
4
+ import { createModule } from "../src/create-module.js";
5
+ import * as py from "../src/index.js";
6
+ import { assertFileContents, toSourceTextMultiple } from "./utils.js";
7
+ describe("TYPE_CHECKING imports", () => {
8
+ it("imports type-only references inside TYPE_CHECKING block", () => {
9
+ const userClassRef = refkey();
10
+ const result = toSourceTextMultiple([_$createComponent(py.SourceFile, {
11
+ path: "models.py",
12
+ get children() {
13
+ return _$createComponent(py.ClassDeclaration, {
14
+ name: "User",
15
+ refkey: userClassRef
16
+ }, {
17
+ fileName: import.meta.url,
18
+ lineNumber: 13,
19
+ columnNumber: 9
20
+ });
21
+ }
22
+ }, {
23
+ fileName: import.meta.url,
24
+ lineNumber: 12,
25
+ columnNumber: 7
26
+ }), _$createComponent(py.SourceFile, {
27
+ path: "service.py",
28
+ get children() {
29
+ return _$createComponent(py.FunctionDeclaration, {
30
+ name: "process_user",
31
+ parameters: [{
32
+ name: "user",
33
+ type: userClassRef
34
+ }],
35
+ returnType: "None",
36
+ children: "pass"
37
+ }, {
38
+ fileName: import.meta.url,
39
+ lineNumber: 16,
40
+ columnNumber: 9
41
+ });
42
+ }
43
+ }, {
44
+ fileName: import.meta.url,
45
+ lineNumber: 15,
46
+ columnNumber: 7
47
+ })]);
48
+ assertFileContents(result, {
49
+ "models.py": `
50
+ class User:
51
+ pass
52
+
53
+ `,
54
+ "service.py": `
55
+ from typing import TYPE_CHECKING
56
+
57
+ if TYPE_CHECKING:
58
+ from models import User
59
+
60
+
61
+ def process_user(user: User) -> None:
62
+ pass
63
+
64
+ `
65
+ });
66
+ });
67
+ it("imports value references outside TYPE_CHECKING block", () => {
68
+ const userClassRef = refkey();
69
+ const result = toSourceTextMultiple([_$createComponent(py.SourceFile, {
70
+ path: "models.py",
71
+ get children() {
72
+ return _$createComponent(py.ClassDeclaration, {
73
+ name: "User",
74
+ refkey: userClassRef
75
+ }, {
76
+ fileName: import.meta.url,
77
+ lineNumber: 51,
78
+ columnNumber: 9
79
+ });
80
+ }
81
+ }, {
82
+ fileName: import.meta.url,
83
+ lineNumber: 50,
84
+ columnNumber: 7
85
+ }), _$createComponent(py.SourceFile, {
86
+ path: "service.py",
87
+ get children() {
88
+ return _$createComponent(py.FunctionDeclaration, {
89
+ name: "create_user",
90
+ returnType: "None",
91
+ get children() {
92
+ return _$createComponent(py.VariableDeclaration, {
93
+ name: "user",
94
+ get initializer() {
95
+ return _$createComponent(py.ClassInstantiation, {
96
+ target: userClassRef
97
+ }, {
98
+ fileName: import.meta.url,
99
+ lineNumber: 57,
100
+ columnNumber: 26
101
+ });
102
+ }
103
+ }, {
104
+ fileName: import.meta.url,
105
+ lineNumber: 55,
106
+ columnNumber: 11
107
+ });
108
+ }
109
+ }, {
110
+ fileName: import.meta.url,
111
+ lineNumber: 54,
112
+ columnNumber: 9
113
+ });
114
+ }
115
+ }, {
116
+ fileName: import.meta.url,
117
+ lineNumber: 53,
118
+ columnNumber: 7
119
+ })]);
120
+ assertFileContents(result, {
121
+ "models.py": `
122
+ class User:
123
+ pass
124
+
125
+ `,
126
+ "service.py": `
127
+ from models import User
128
+
129
+
130
+ def create_user() -> None:
131
+ user = User()
132
+
133
+ `
134
+ });
135
+ });
136
+ it("upgrades type-only import to regular import when also used as value", () => {
137
+ const userClassRef = refkey();
138
+ const result = toSourceTextMultiple([_$createComponent(py.SourceFile, {
139
+ path: "models.py",
140
+ get children() {
141
+ return _$createComponent(py.ClassDeclaration, {
142
+ name: "User",
143
+ refkey: userClassRef
144
+ }, {
145
+ fileName: import.meta.url,
146
+ lineNumber: 85,
147
+ columnNumber: 9
148
+ });
149
+ }
150
+ }, {
151
+ fileName: import.meta.url,
152
+ lineNumber: 84,
153
+ columnNumber: 7
154
+ }), _$createComponent(py.SourceFile, {
155
+ path: "service.py",
156
+ get children() {
157
+ return _$createComponent(py.FunctionDeclaration, {
158
+ name: "create_user",
159
+ parameters: [{
160
+ name: "existing",
161
+ type: userClassRef
162
+ }],
163
+ returnType: userClassRef,
164
+ get children() {
165
+ return _$createComponent(py.StatementList, {
166
+ get children() {
167
+ return [_$createComponent(py.VariableDeclaration, {
168
+ name: "user",
169
+ get initializer() {
170
+ return _$createComponent(py.ClassInstantiation, {
171
+ target: userClassRef
172
+ }, {
173
+ fileName: import.meta.url,
174
+ lineNumber: 96,
175
+ columnNumber: 28
176
+ });
177
+ }
178
+ }, {
179
+ fileName: import.meta.url,
180
+ lineNumber: 94,
181
+ columnNumber: 13
182
+ }), ["return user"]];
183
+ }
184
+ }, {
185
+ fileName: import.meta.url,
186
+ lineNumber: 93,
187
+ columnNumber: 11
188
+ });
189
+ }
190
+ }, {
191
+ fileName: import.meta.url,
192
+ lineNumber: 88,
193
+ columnNumber: 9
194
+ });
195
+ }
196
+ }, {
197
+ fileName: import.meta.url,
198
+ lineNumber: 87,
199
+ columnNumber: 7
200
+ })]);
201
+
202
+ // Since User is used both as a type (parameter type, return type) and
203
+ // as a value (ClassInstantiation), it should be a regular import
204
+ assertFileContents(result, {
205
+ "models.py": `
206
+ class User:
207
+ pass
208
+
209
+ `,
210
+ "service.py": `
211
+ from models import User
212
+
213
+
214
+ def create_user(existing: User) -> User:
215
+ user = User()
216
+ return user
217
+
218
+ `
219
+ });
220
+ });
221
+ it("handles mixed type-only and regular imports from same module", () => {
222
+ const userClassRef = refkey();
223
+ const helperFuncRef = refkey();
224
+ const result = toSourceTextMultiple([_$createComponent(py.SourceFile, {
225
+ path: "models.py",
226
+ get children() {
227
+ return [_$createComponent(py.ClassDeclaration, {
228
+ name: "User",
229
+ refkey: userClassRef
230
+ }, {
231
+ fileName: import.meta.url,
232
+ lineNumber: 130,
233
+ columnNumber: 9
234
+ }), _$createComponent(py.FunctionDeclaration, {
235
+ name: "helper",
236
+ refkey: helperFuncRef,
237
+ children: "pass"
238
+ }, {
239
+ fileName: import.meta.url,
240
+ lineNumber: 131,
241
+ columnNumber: 9
242
+ })];
243
+ }
244
+ }, {
245
+ fileName: import.meta.url,
246
+ lineNumber: 129,
247
+ columnNumber: 7
248
+ }), _$createComponent(py.SourceFile, {
249
+ path: "service.py",
250
+ get children() {
251
+ return _$createComponent(py.FunctionDeclaration, {
252
+ name: "process",
253
+ parameters: [{
254
+ name: "user",
255
+ type: userClassRef
256
+ }],
257
+ returnType: "None",
258
+ get children() {
259
+ return _$createComponent(py.FunctionCallExpression, {
260
+ target: helperFuncRef
261
+ }, {
262
+ fileName: import.meta.url,
263
+ lineNumber: 141,
264
+ columnNumber: 11
265
+ });
266
+ }
267
+ }, {
268
+ fileName: import.meta.url,
269
+ lineNumber: 136,
270
+ columnNumber: 9
271
+ });
272
+ }
273
+ }, {
274
+ fileName: import.meta.url,
275
+ lineNumber: 135,
276
+ columnNumber: 7
277
+ })]);
278
+
279
+ // helper is used as a value (function call), User is only used as type
280
+ assertFileContents(result, {
281
+ "models.py": `
282
+ class User:
283
+ pass
284
+
285
+
286
+ def helper():
287
+ pass
288
+
289
+ `,
290
+ "service.py": `
291
+ from models import helper
292
+ from typing import TYPE_CHECKING
293
+
294
+ if TYPE_CHECKING:
295
+ from models import User
296
+
297
+
298
+ def process(user: User) -> None:
299
+ helper()
300
+
301
+ `
302
+ });
303
+ });
304
+ it("handles return type as type-only import", () => {
305
+ const resultTypeRef = refkey();
306
+ const result = toSourceTextMultiple([_$createComponent(py.SourceFile, {
307
+ path: "types.py",
308
+ get children() {
309
+ return _$createComponent(py.ClassDeclaration, {
310
+ name: "Result",
311
+ refkey: resultTypeRef
312
+ }, {
313
+ fileName: import.meta.url,
314
+ lineNumber: 177,
315
+ columnNumber: 9
316
+ });
317
+ }
318
+ }, {
319
+ fileName: import.meta.url,
320
+ lineNumber: 176,
321
+ columnNumber: 7
322
+ }), _$createComponent(py.SourceFile, {
323
+ path: "main.py",
324
+ get children() {
325
+ return _$createComponent(py.FunctionDeclaration, {
326
+ name: "get_result",
327
+ returnType: resultTypeRef,
328
+ children: "pass"
329
+ }, {
330
+ fileName: import.meta.url,
331
+ lineNumber: 180,
332
+ columnNumber: 9
333
+ });
334
+ }
335
+ }, {
336
+ fileName: import.meta.url,
337
+ lineNumber: 179,
338
+ columnNumber: 7
339
+ })]);
340
+ assertFileContents(result, {
341
+ "types.py": `
342
+ class Result:
343
+ pass
344
+
345
+ `,
346
+ "main.py": `
347
+ from typing import TYPE_CHECKING
348
+
349
+ if TYPE_CHECKING:
350
+ from types import Result
351
+
352
+
353
+ def get_result() -> Result:
354
+ pass
355
+
356
+ `
357
+ });
358
+ });
359
+ it("handles variable type annotation as type-only import", () => {
360
+ const configTypeRef = refkey();
361
+ const result = toSourceTextMultiple([_$createComponent(py.SourceFile, {
362
+ path: "types.py",
363
+ get children() {
364
+ return _$createComponent(py.ClassDeclaration, {
365
+ name: "Config",
366
+ refkey: configTypeRef
367
+ }, {
368
+ fileName: import.meta.url,
369
+ lineNumber: 211,
370
+ columnNumber: 9
371
+ });
372
+ }
373
+ }, {
374
+ fileName: import.meta.url,
375
+ lineNumber: 210,
376
+ columnNumber: 7
377
+ }), _$createComponent(py.SourceFile, {
378
+ path: "main.py",
379
+ get children() {
380
+ return _$createComponent(py.VariableDeclaration, {
381
+ name: "config",
382
+ type: configTypeRef,
383
+ omitNone: true
384
+ }, {
385
+ fileName: import.meta.url,
386
+ lineNumber: 214,
387
+ columnNumber: 9
388
+ });
389
+ }
390
+ }, {
391
+ fileName: import.meta.url,
392
+ lineNumber: 213,
393
+ columnNumber: 7
394
+ })]);
395
+ assertFileContents(result, {
396
+ "types.py": `
397
+ class Config:
398
+ pass
399
+
400
+ `,
401
+ "main.py": `
402
+ from typing import TYPE_CHECKING
403
+
404
+ if TYPE_CHECKING:
405
+ from types import Config
406
+
407
+ config: Config
408
+ `
409
+ });
410
+ });
411
+ it("handles TypeReference component as type-only import", () => {
412
+ const myTypeRef = refkey();
413
+ const result = toSourceTextMultiple([_$createComponent(py.SourceFile, {
414
+ path: "types.py",
415
+ get children() {
416
+ return _$createComponent(py.ClassDeclaration, {
417
+ name: "MyType",
418
+ refkey: myTypeRef
419
+ }, {
420
+ fileName: import.meta.url,
421
+ lineNumber: 240,
422
+ columnNumber: 9
423
+ });
424
+ }
425
+ }, {
426
+ fileName: import.meta.url,
427
+ lineNumber: 239,
428
+ columnNumber: 7
429
+ }), _$createComponent(py.SourceFile, {
430
+ path: "main.py",
431
+ get children() {
432
+ return _$createComponent(py.VariableDeclaration, {
433
+ name: "value",
434
+ get type() {
435
+ return _$createComponent(py.TypeReference, {
436
+ refkey: myTypeRef
437
+ }, {
438
+ fileName: import.meta.url,
439
+ lineNumber: 245,
440
+ columnNumber: 17
441
+ });
442
+ },
443
+ omitNone: true
444
+ }, {
445
+ fileName: import.meta.url,
446
+ lineNumber: 243,
447
+ columnNumber: 9
448
+ });
449
+ }
450
+ }, {
451
+ fileName: import.meta.url,
452
+ lineNumber: 242,
453
+ columnNumber: 7
454
+ })]);
455
+ assertFileContents(result, {
456
+ "types.py": `
457
+ class MyType:
458
+ pass
459
+
460
+ `,
461
+ "main.py": `
462
+ from typing import TYPE_CHECKING
463
+
464
+ if TYPE_CHECKING:
465
+ from types import MyType
466
+
467
+ value: MyType
468
+ `
469
+ });
470
+ });
471
+ it("handles class bases as regular import (runtime requirement)", () => {
472
+ const baseClassRef = refkey();
473
+ const result = toSourceTextMultiple([_$createComponent(py.SourceFile, {
474
+ path: "base.py",
475
+ get children() {
476
+ return _$createComponent(py.ClassDeclaration, {
477
+ name: "BaseClass",
478
+ refkey: baseClassRef
479
+ }, {
480
+ fileName: import.meta.url,
481
+ lineNumber: 273,
482
+ columnNumber: 9
483
+ });
484
+ }
485
+ }, {
486
+ fileName: import.meta.url,
487
+ lineNumber: 272,
488
+ columnNumber: 7
489
+ }), _$createComponent(py.SourceFile, {
490
+ path: "derived.py",
491
+ get children() {
492
+ return _$createComponent(py.ClassDeclaration, {
493
+ name: "DerivedClass",
494
+ bases: [baseClassRef]
495
+ }, {
496
+ fileName: import.meta.url,
497
+ lineNumber: 276,
498
+ columnNumber: 9
499
+ });
500
+ }
501
+ }, {
502
+ fileName: import.meta.url,
503
+ lineNumber: 275,
504
+ columnNumber: 7
505
+ })]);
506
+
507
+ // Class bases require runtime access, so they should NOT be
508
+ // inside a TYPE_CHECKING block
509
+ assertFileContents(result, {
510
+ "base.py": `
511
+ class BaseClass:
512
+ pass
513
+
514
+ `,
515
+ "derived.py": `
516
+ from base import BaseClass
517
+
518
+
519
+ class DerivedClass(BaseClass):
520
+ pass
521
+
522
+ `
523
+ });
524
+ });
525
+ it("renders regular imports before TYPE_CHECKING block", () => {
526
+ // Create a typing module with multiple exports
527
+ const typingModule = createModule({
528
+ name: "typing",
529
+ descriptor: {
530
+ ".": ["TYPE_CHECKING", "cast"]
531
+ }
532
+ });
533
+
534
+ // Create a third-party module
535
+ const requestsModule = createModule({
536
+ name: "requests",
537
+ descriptor: {
538
+ ".": ["get"]
539
+ }
540
+ });
541
+ const userClassRef = refkey();
542
+ const result = toSourceTextMultiple([_$createComponent(py.SourceFile, {
543
+ path: "models.py",
544
+ get children() {
545
+ return _$createComponent(py.ClassDeclaration, {
546
+ name: "User",
547
+ refkey: userClassRef
548
+ }, {
549
+ fileName: import.meta.url,
550
+ lineNumber: 321,
551
+ columnNumber: 11
552
+ });
553
+ }
554
+ }, {
555
+ fileName: import.meta.url,
556
+ lineNumber: 320,
557
+ columnNumber: 9
558
+ }), _$createComponent(py.SourceFile, {
559
+ path: "service.py",
560
+ get children() {
561
+ return _$createComponent(py.FunctionDeclaration, {
562
+ name: "get_users",
563
+ parameters: [{
564
+ name: "user",
565
+ type: userClassRef
566
+ }],
567
+ returnType: "str",
568
+ get children() {
569
+ return _$createComponent(py.StatementList, {
570
+ get children() {
571
+ return [["response = ", _$memo(() => requestsModule["."].get, false, "requestsModule[.].get"), "(\"https://example.com\")"], ["return ", _$memo(() => typingModule["."].cast, false, "typingModule[.].cast"), "(str, user)"]];
572
+ }
573
+ }, {
574
+ fileName: import.meta.url,
575
+ lineNumber: 329,
576
+ columnNumber: 13
577
+ });
578
+ }
579
+ }, {
580
+ fileName: import.meta.url,
581
+ lineNumber: 324,
582
+ columnNumber: 11
583
+ });
584
+ }
585
+ }, {
586
+ fileName: import.meta.url,
587
+ lineNumber: 323,
588
+ columnNumber: 9
589
+ })], {
590
+ externals: [typingModule, requestsModule]
591
+ });
592
+
593
+ // Regular imports first (sorted alphabetically), then TYPE_CHECKING block
594
+ assertFileContents(result, {
595
+ "models.py": `
596
+ class User:
597
+ pass
598
+
599
+ `,
600
+ "service.py": `
601
+ from requests import get
602
+ from typing import cast
603
+ from typing import TYPE_CHECKING
604
+
605
+ if TYPE_CHECKING:
606
+ from models import User
607
+
608
+
609
+ def get_users(user: User) -> str:
610
+ response = get("https://example.com")
611
+ return cast(str, user)
612
+
613
+ `
614
+ });
615
+ });
616
+ });
617
+ //# sourceMappingURL=type-checking-imports.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["refkey","describe","it","createModule","py","assertFileContents","toSourceTextMultiple","userClassRef","result","_$createComponent","SourceFile","path","children","ClassDeclaration","name","fileName","import","meta","url","lineNumber","columnNumber","FunctionDeclaration","parameters","type","returnType","VariableDeclaration","initializer","ClassInstantiation","target","StatementList","helperFuncRef","FunctionCallExpression","resultTypeRef","configTypeRef","omitNone","myTypeRef","TypeReference","baseClassRef","bases","typingModule","descriptor","requestsModule","_$memo","get","cast","externals"],"sources":["../../../test/type-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