@alloy-js/python 0.3.0-dev.1 → 0.3.0-dev.2
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.
- package/dist/src/builtins/python.d.ts +3 -0
- package/dist/src/builtins/python.d.ts.map +1 -1
- package/dist/src/builtins/python.js +6 -0
- package/dist/src/builtins/python.js.map +1 -1
- package/dist/src/components/DataclassDeclaration.d.ts +41 -0
- package/dist/src/components/DataclassDeclaration.d.ts.map +1 -0
- package/dist/src/components/DataclassDeclaration.js +150 -0
- package/dist/src/components/DataclassDeclaration.js.map +1 -0
- package/dist/src/components/PyDoc.d.ts.map +1 -1
- package/dist/src/components/PyDoc.js +59 -15
- package/dist/src/components/PyDoc.js.map +1 -1
- package/dist/src/components/UnionTypeExpression.d.ts.map +1 -1
- package/dist/src/components/UnionTypeExpression.js +6 -6
- package/dist/src/components/UnionTypeExpression.js.map +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +1 -0
- package/dist/src/components/index.js.map +1 -1
- package/dist/test/dataclassdeclarations.test.d.ts +2 -0
- package/dist/test/dataclassdeclarations.test.d.ts.map +1 -0
- package/dist/test/dataclassdeclarations.test.js +630 -0
- package/dist/test/dataclassdeclarations.test.js.map +1 -0
- package/dist/test/pydocs.test.js +11 -19
- package/dist/test/pydocs.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/builtins/python.ts +7 -0
- package/src/components/DataclassDeclaration.tsx +185 -0
- package/src/components/PyDoc.tsx +66 -20
- package/src/components/UnionTypeExpression.tsx +4 -7
- package/src/components/index.ts +1 -0
- package/temp/api.json +267 -0
- package/test/dataclassdeclarations.test.tsx +585 -0
- package/test/pydocs.test.tsx +11 -24
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Prose, namekey } from "@alloy-js/core";
|
|
3
|
+
import { d } from "@alloy-js/core/testing";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { dataclassesModule } from "../src/builtins/python.js";
|
|
6
|
+
import * as py from "../src/index.js";
|
|
7
|
+
import { toSourceText } from "./utils.js";
|
|
8
|
+
describe("DataclassDeclaration", () => {
|
|
9
|
+
it("Creates a dataclass with a class doc", () => {
|
|
10
|
+
const doc = _$createComponent(py.ClassDoc, {
|
|
11
|
+
get description() {
|
|
12
|
+
return [_$createComponent(Prose, {
|
|
13
|
+
children: "Represents a user."
|
|
14
|
+
})];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
18
|
+
path: "user.py",
|
|
19
|
+
get children() {
|
|
20
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
21
|
+
name: "User",
|
|
22
|
+
doc: doc
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
})], {
|
|
26
|
+
externals: [dataclassesModule]
|
|
27
|
+
});
|
|
28
|
+
expect(res).toRenderTo(d`
|
|
29
|
+
from dataclasses import dataclass
|
|
30
|
+
|
|
31
|
+
@dataclass
|
|
32
|
+
class User:
|
|
33
|
+
"""
|
|
34
|
+
Represents a user.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
pass
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
`);
|
|
41
|
+
});
|
|
42
|
+
it("Creates a dataclass with fields and defaults", () => {
|
|
43
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
44
|
+
path: "user.py",
|
|
45
|
+
get children() {
|
|
46
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
47
|
+
name: "User",
|
|
48
|
+
get children() {
|
|
49
|
+
return [_$createComponent(py.VariableDeclaration, {
|
|
50
|
+
instanceVariable: true,
|
|
51
|
+
omitNone: true,
|
|
52
|
+
name: "id",
|
|
53
|
+
type: "int"
|
|
54
|
+
}), _$createComponent(py.VariableDeclaration, {
|
|
55
|
+
instanceVariable: true,
|
|
56
|
+
get name() {
|
|
57
|
+
return namekey("_", {
|
|
58
|
+
ignoreNamePolicy: true
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
get type() {
|
|
62
|
+
return dataclassesModule["."].KW_ONLY;
|
|
63
|
+
},
|
|
64
|
+
omitNone: true
|
|
65
|
+
}), _$createComponent(py.VariableDeclaration, {
|
|
66
|
+
instanceVariable: true,
|
|
67
|
+
name: "name",
|
|
68
|
+
type: "str",
|
|
69
|
+
initializer: "Anonymous"
|
|
70
|
+
})];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
})], {
|
|
75
|
+
externals: [dataclassesModule]
|
|
76
|
+
});
|
|
77
|
+
expect(res).toRenderTo(d`
|
|
78
|
+
from dataclasses import dataclass
|
|
79
|
+
from dataclasses import KW_ONLY
|
|
80
|
+
|
|
81
|
+
@dataclass
|
|
82
|
+
class User:
|
|
83
|
+
id: int
|
|
84
|
+
_: KW_ONLY
|
|
85
|
+
name: str = "Anonymous"
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
`);
|
|
89
|
+
});
|
|
90
|
+
it("Creates a dataclass with keyword arguments", () => {
|
|
91
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
92
|
+
path: "user.py",
|
|
93
|
+
get children() {
|
|
94
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
95
|
+
name: "User",
|
|
96
|
+
frozen: true,
|
|
97
|
+
slots: true,
|
|
98
|
+
kwOnly: true,
|
|
99
|
+
get children() {
|
|
100
|
+
return _$createComponent(py.VariableDeclaration, {
|
|
101
|
+
instanceVariable: true,
|
|
102
|
+
omitNone: true,
|
|
103
|
+
name: "id",
|
|
104
|
+
type: "int"
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
})], {
|
|
110
|
+
externals: [dataclassesModule]
|
|
111
|
+
});
|
|
112
|
+
expect(res).toRenderTo(d`
|
|
113
|
+
from dataclasses import dataclass
|
|
114
|
+
|
|
115
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
116
|
+
class User:
|
|
117
|
+
id: int
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
`);
|
|
121
|
+
});
|
|
122
|
+
it("Creates a dataclass with all keyword arguments", () => {
|
|
123
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
124
|
+
path: "user.py",
|
|
125
|
+
get children() {
|
|
126
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
127
|
+
name: "User",
|
|
128
|
+
init: true,
|
|
129
|
+
repr: false,
|
|
130
|
+
eq: true,
|
|
131
|
+
order: false,
|
|
132
|
+
unsafeHash: true,
|
|
133
|
+
frozen: true,
|
|
134
|
+
matchArgs: false,
|
|
135
|
+
kwOnly: true,
|
|
136
|
+
slots: true,
|
|
137
|
+
weakrefSlot: false
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
})], {
|
|
141
|
+
externals: [dataclassesModule]
|
|
142
|
+
});
|
|
143
|
+
expect(res).toRenderTo(d`
|
|
144
|
+
from dataclasses import dataclass
|
|
145
|
+
|
|
146
|
+
@dataclass(init=True, repr=False, eq=True, order=False, unsafe_hash=True, frozen=True, match_args=False, kw_only=True, slots=True, weakref_slot=False)
|
|
147
|
+
class User:
|
|
148
|
+
pass
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
`);
|
|
152
|
+
});
|
|
153
|
+
it("Throws error when weakref_slot=True without slots=True", () => {
|
|
154
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
155
|
+
path: "user.py",
|
|
156
|
+
get children() {
|
|
157
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
158
|
+
name: "User",
|
|
159
|
+
weakrefSlot: true
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
})], {
|
|
163
|
+
externals: [dataclassesModule]
|
|
164
|
+
})).toThrowError(/weakref_slot=True requires slots=True in @dataclass decorator/);
|
|
165
|
+
});
|
|
166
|
+
it("Allows weakref_slot=True when slots=True", () => {
|
|
167
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
168
|
+
path: "user.py",
|
|
169
|
+
get children() {
|
|
170
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
171
|
+
name: "User",
|
|
172
|
+
slots: true,
|
|
173
|
+
weakrefSlot: true
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
})], {
|
|
177
|
+
externals: [dataclassesModule]
|
|
178
|
+
});
|
|
179
|
+
expect(res).toRenderTo(d`
|
|
180
|
+
from dataclasses import dataclass
|
|
181
|
+
|
|
182
|
+
@dataclass(slots=True, weakref_slot=True)
|
|
183
|
+
class User:
|
|
184
|
+
pass
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
`);
|
|
188
|
+
});
|
|
189
|
+
it("Throws error when order=True and eq=False", () => {
|
|
190
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
191
|
+
path: "user.py",
|
|
192
|
+
get children() {
|
|
193
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
194
|
+
name: "User",
|
|
195
|
+
order: true,
|
|
196
|
+
eq: false
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
})], {
|
|
200
|
+
externals: [dataclassesModule]
|
|
201
|
+
})).toThrowError(/order=True requires eq=True/);
|
|
202
|
+
});
|
|
203
|
+
it("Creates a dataclass with order=True and no conflicting methods", () => {
|
|
204
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
205
|
+
path: "user.py",
|
|
206
|
+
get children() {
|
|
207
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
208
|
+
name: "User",
|
|
209
|
+
order: true
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
})], {
|
|
213
|
+
externals: [dataclassesModule]
|
|
214
|
+
});
|
|
215
|
+
expect(res).toRenderTo(d`
|
|
216
|
+
from dataclasses import dataclass
|
|
217
|
+
|
|
218
|
+
@dataclass(order=True)
|
|
219
|
+
class User:
|
|
220
|
+
pass
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
`);
|
|
224
|
+
});
|
|
225
|
+
it("Throws error when order=True and class defines __lt__", () => {
|
|
226
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
227
|
+
path: "user.py",
|
|
228
|
+
get children() {
|
|
229
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
230
|
+
name: "User",
|
|
231
|
+
order: true,
|
|
232
|
+
get children() {
|
|
233
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
234
|
+
name: "__lt__"
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
})], {
|
|
240
|
+
externals: [dataclassesModule]
|
|
241
|
+
})).toThrowError(/Cannot specify order=True when the class already defines __lt__\(\)/);
|
|
242
|
+
});
|
|
243
|
+
it("Throws error when order=True and class defines __le__", () => {
|
|
244
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
245
|
+
path: "user.py",
|
|
246
|
+
get children() {
|
|
247
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
248
|
+
name: "User",
|
|
249
|
+
order: true,
|
|
250
|
+
get children() {
|
|
251
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
252
|
+
name: "__le__"
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
})], {
|
|
258
|
+
externals: [dataclassesModule]
|
|
259
|
+
})).toThrowError(/Cannot specify order=True when the class already defines __le__\(\)/);
|
|
260
|
+
});
|
|
261
|
+
it("Throws error when order=True and class defines __gt__", () => {
|
|
262
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
263
|
+
path: "user.py",
|
|
264
|
+
get children() {
|
|
265
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
266
|
+
name: "User",
|
|
267
|
+
order: true,
|
|
268
|
+
get children() {
|
|
269
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
270
|
+
name: "__gt__"
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
})], {
|
|
276
|
+
externals: [dataclassesModule]
|
|
277
|
+
})).toThrowError(/Cannot specify order=True when the class already defines __gt__\(\)/);
|
|
278
|
+
});
|
|
279
|
+
it("Throws error when order=True and class defines __ge__", () => {
|
|
280
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
281
|
+
path: "user.py",
|
|
282
|
+
get children() {
|
|
283
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
284
|
+
name: "User",
|
|
285
|
+
order: true,
|
|
286
|
+
get children() {
|
|
287
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
288
|
+
name: "__ge__"
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
})], {
|
|
294
|
+
externals: [dataclassesModule]
|
|
295
|
+
})).toThrowError(/Cannot specify order=True when the class already defines __ge__\(\)/);
|
|
296
|
+
});
|
|
297
|
+
it("Throws error when order=True and a wrapper defines __lt__", () => {
|
|
298
|
+
function Wrapper() {
|
|
299
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
300
|
+
name: "__lt__"
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
304
|
+
path: "user.py",
|
|
305
|
+
get children() {
|
|
306
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
307
|
+
name: "User",
|
|
308
|
+
order: true,
|
|
309
|
+
get children() {
|
|
310
|
+
return _$createComponent(Wrapper, {});
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
})], {
|
|
315
|
+
externals: [dataclassesModule]
|
|
316
|
+
})).toThrowError(/Cannot specify order=True when the class already defines __lt__\(\)/);
|
|
317
|
+
});
|
|
318
|
+
it("Throws error when unsafe_hash=True and class defines __hash__", () => {
|
|
319
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
320
|
+
path: "user.py",
|
|
321
|
+
get children() {
|
|
322
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
323
|
+
name: "User",
|
|
324
|
+
unsafeHash: true,
|
|
325
|
+
get children() {
|
|
326
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
327
|
+
name: "__hash__"
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
})], {
|
|
333
|
+
externals: [dataclassesModule]
|
|
334
|
+
})).toThrowError(/Cannot specify unsafe_hash=True when the class already defines __hash__\(\)/);
|
|
335
|
+
});
|
|
336
|
+
it("Throws error when frozen=True and class defines __setattr__", () => {
|
|
337
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
338
|
+
path: "user.py",
|
|
339
|
+
get children() {
|
|
340
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
341
|
+
name: "User",
|
|
342
|
+
frozen: true,
|
|
343
|
+
get children() {
|
|
344
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
345
|
+
name: "__setattr__"
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
})], {
|
|
351
|
+
externals: [dataclassesModule]
|
|
352
|
+
})).toThrowError(/Cannot specify frozen=True when the class already defines __setattr__\(\)/);
|
|
353
|
+
});
|
|
354
|
+
it("Throws errorwhen frozen=True and class defines __delattr__", () => {
|
|
355
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
356
|
+
path: "user.py",
|
|
357
|
+
get children() {
|
|
358
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
359
|
+
name: "User",
|
|
360
|
+
frozen: true,
|
|
361
|
+
get children() {
|
|
362
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
363
|
+
name: "__delattr__"
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
})], {
|
|
369
|
+
externals: [dataclassesModule]
|
|
370
|
+
})).toThrowError(/Cannot specify frozen=True when the class already defines __delattr__\(\)/);
|
|
371
|
+
});
|
|
372
|
+
it("Throws error when slots=True and class defines __slots__", () => {
|
|
373
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
374
|
+
path: "user.py",
|
|
375
|
+
get children() {
|
|
376
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
377
|
+
name: "User",
|
|
378
|
+
slots: true,
|
|
379
|
+
get children() {
|
|
380
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
381
|
+
name: "__slots__"
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
})], {
|
|
387
|
+
externals: [dataclassesModule]
|
|
388
|
+
})).toThrowError(/Cannot specify slots=True when the class already defines __slots__\(\)/);
|
|
389
|
+
});
|
|
390
|
+
it("Creates a dataclass with kw_only=True on decorator (sentinel not used)", () => {
|
|
391
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
392
|
+
path: "user.py",
|
|
393
|
+
get children() {
|
|
394
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
395
|
+
name: "User",
|
|
396
|
+
kwOnly: true,
|
|
397
|
+
get children() {
|
|
398
|
+
return _$createComponent(py.VariableDeclaration, {
|
|
399
|
+
instanceVariable: true,
|
|
400
|
+
omitNone: true,
|
|
401
|
+
name: "id",
|
|
402
|
+
type: "int"
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
})], {
|
|
408
|
+
externals: [dataclassesModule]
|
|
409
|
+
});
|
|
410
|
+
expect(res).toRenderTo(d`
|
|
411
|
+
from dataclasses import dataclass
|
|
412
|
+
|
|
413
|
+
@dataclass(kw_only=True)
|
|
414
|
+
class User:
|
|
415
|
+
id: int
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
`);
|
|
419
|
+
});
|
|
420
|
+
it("Creates a dataclass with base classes", () => {
|
|
421
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
422
|
+
path: "user.py",
|
|
423
|
+
get children() {
|
|
424
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
425
|
+
name: "User",
|
|
426
|
+
bases: ["Base"]
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
})], {
|
|
430
|
+
externals: [dataclassesModule]
|
|
431
|
+
});
|
|
432
|
+
expect(res).toRenderTo(d`
|
|
433
|
+
from dataclasses import dataclass
|
|
434
|
+
|
|
435
|
+
@dataclass
|
|
436
|
+
class User(Base):
|
|
437
|
+
pass
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
`);
|
|
441
|
+
});
|
|
442
|
+
it("Throws error when more than one KW_ONLY sentinel is present", () => {
|
|
443
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
444
|
+
path: "user.py",
|
|
445
|
+
get children() {
|
|
446
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
447
|
+
name: "User",
|
|
448
|
+
get children() {
|
|
449
|
+
return [_$createComponent(py.VariableDeclaration, {
|
|
450
|
+
instanceVariable: true,
|
|
451
|
+
get name() {
|
|
452
|
+
return namekey("_", {
|
|
453
|
+
ignoreNamePolicy: true
|
|
454
|
+
});
|
|
455
|
+
},
|
|
456
|
+
get type() {
|
|
457
|
+
return dataclassesModule["."].KW_ONLY;
|
|
458
|
+
},
|
|
459
|
+
omitNone: true
|
|
460
|
+
}), _$createComponent(py.VariableDeclaration, {
|
|
461
|
+
instanceVariable: true,
|
|
462
|
+
get name() {
|
|
463
|
+
return namekey("_", {
|
|
464
|
+
ignoreNamePolicy: true
|
|
465
|
+
});
|
|
466
|
+
},
|
|
467
|
+
get type() {
|
|
468
|
+
return dataclassesModule["."].KW_ONLY;
|
|
469
|
+
},
|
|
470
|
+
omitNone: true
|
|
471
|
+
})];
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
})], {
|
|
476
|
+
externals: [dataclassesModule]
|
|
477
|
+
})).toThrowError(/Only one KW_ONLY sentinel is allowed per dataclass body/);
|
|
478
|
+
});
|
|
479
|
+
it("Will raise arg validation errors first over member conflicts", () => {
|
|
480
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
481
|
+
path: "user.py",
|
|
482
|
+
get children() {
|
|
483
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
484
|
+
name: "User",
|
|
485
|
+
order: true,
|
|
486
|
+
eq: false,
|
|
487
|
+
get children() {
|
|
488
|
+
return _$createComponent(py.DunderMethodDeclaration, {
|
|
489
|
+
name: "__lt__"
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
})], {
|
|
495
|
+
externals: [dataclassesModule]
|
|
496
|
+
})).toThrowError(/order=True requires eq=True/);
|
|
497
|
+
});
|
|
498
|
+
it("Does not raise errors for member conflict checks without the equivalent kwargs", () => {
|
|
499
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
500
|
+
path: "user.py",
|
|
501
|
+
get children() {
|
|
502
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
503
|
+
name: "User",
|
|
504
|
+
get children() {
|
|
505
|
+
return [_$createComponent(py.DunderMethodDeclaration, {
|
|
506
|
+
name: "__lt__"
|
|
507
|
+
}), _$createComponent(py.DunderMethodDeclaration, {
|
|
508
|
+
name: "__slots__"
|
|
509
|
+
}), _$createComponent(py.DunderMethodDeclaration, {
|
|
510
|
+
name: "__hash__"
|
|
511
|
+
}), _$createComponent(py.DunderMethodDeclaration, {
|
|
512
|
+
name: "__setattr__"
|
|
513
|
+
}), _$createComponent(py.DunderMethodDeclaration, {
|
|
514
|
+
name: "__delattr__"
|
|
515
|
+
})];
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
})], {
|
|
520
|
+
externals: [dataclassesModule]
|
|
521
|
+
})).not.toThrow();
|
|
522
|
+
});
|
|
523
|
+
it("Allows unsafe_hash=True when no __hash__ is defined", () => {
|
|
524
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
525
|
+
path: "user.py",
|
|
526
|
+
get children() {
|
|
527
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
528
|
+
name: "User",
|
|
529
|
+
unsafeHash: true
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
})], {
|
|
533
|
+
externals: [dataclassesModule]
|
|
534
|
+
});
|
|
535
|
+
expect(res).toRenderTo(d`
|
|
536
|
+
from dataclasses import dataclass
|
|
537
|
+
|
|
538
|
+
@dataclass(unsafe_hash=True)
|
|
539
|
+
class User:
|
|
540
|
+
pass
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
`);
|
|
544
|
+
});
|
|
545
|
+
it("Counts KW_ONLY sentinels through wrappers (symbol-level)", () => {
|
|
546
|
+
function Wrapper() {
|
|
547
|
+
return _$createComponent(py.VariableDeclaration, {
|
|
548
|
+
instanceVariable: true,
|
|
549
|
+
get name() {
|
|
550
|
+
return namekey("_", {
|
|
551
|
+
ignoreNamePolicy: true
|
|
552
|
+
});
|
|
553
|
+
},
|
|
554
|
+
get type() {
|
|
555
|
+
return dataclassesModule["."].KW_ONLY;
|
|
556
|
+
},
|
|
557
|
+
omitNone: true
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
expect(() => toSourceText([_$createComponent(py.SourceFile, {
|
|
561
|
+
path: "user.py",
|
|
562
|
+
get children() {
|
|
563
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
564
|
+
name: "User",
|
|
565
|
+
get children() {
|
|
566
|
+
return [_$createComponent(py.VariableDeclaration, {
|
|
567
|
+
instanceVariable: true,
|
|
568
|
+
get name() {
|
|
569
|
+
return namekey("_", {
|
|
570
|
+
ignoreNamePolicy: true
|
|
571
|
+
});
|
|
572
|
+
},
|
|
573
|
+
get type() {
|
|
574
|
+
return dataclassesModule["."].KW_ONLY;
|
|
575
|
+
},
|
|
576
|
+
omitNone: true
|
|
577
|
+
}), _$createComponent(Wrapper, {})];
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
})], {
|
|
582
|
+
externals: [dataclassesModule]
|
|
583
|
+
})).toThrowError(/Only one KW_ONLY sentinel is allowed per dataclass body/);
|
|
584
|
+
});
|
|
585
|
+
it("Allows frozen=True when no conflicting dunders exist", () => {
|
|
586
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
587
|
+
path: "user.py",
|
|
588
|
+
get children() {
|
|
589
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
590
|
+
name: "User",
|
|
591
|
+
frozen: true
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
})], {
|
|
595
|
+
externals: [dataclassesModule]
|
|
596
|
+
});
|
|
597
|
+
expect(res).toRenderTo(d`
|
|
598
|
+
from dataclasses import dataclass
|
|
599
|
+
|
|
600
|
+
@dataclass(frozen=True)
|
|
601
|
+
class User:
|
|
602
|
+
pass
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
`);
|
|
606
|
+
});
|
|
607
|
+
it("Allows slots=True when no __slots__ is defined", () => {
|
|
608
|
+
const res = toSourceText([_$createComponent(py.SourceFile, {
|
|
609
|
+
path: "user.py",
|
|
610
|
+
get children() {
|
|
611
|
+
return _$createComponent(py.DataclassDeclaration, {
|
|
612
|
+
name: "User",
|
|
613
|
+
slots: true
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
})], {
|
|
617
|
+
externals: [dataclassesModule]
|
|
618
|
+
});
|
|
619
|
+
expect(res).toRenderTo(d`
|
|
620
|
+
from dataclasses import dataclass
|
|
621
|
+
|
|
622
|
+
@dataclass(slots=True)
|
|
623
|
+
class User:
|
|
624
|
+
pass
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
`);
|
|
628
|
+
});
|
|
629
|
+
});
|
|
630
|
+
//# sourceMappingURL=dataclassdeclarations.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Prose","namekey","d","describe","expect","it","dataclassesModule","py","toSourceText","doc","_$createComponent","ClassDoc","description","children","res","SourceFile","path","DataclassDeclaration","name","externals","toRenderTo","VariableDeclaration","instanceVariable","omitNone","type","ignoreNamePolicy","KW_ONLY","initializer","frozen","slots","kwOnly","init","repr","eq","order","unsafeHash","matchArgs","weakrefSlot","toThrowError","DunderMethodDeclaration","Wrapper","bases","not","toThrow"],"sources":["../../test/dataclassdeclarations.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,KAAK,EAAEC,OAAO,QAAQ,gBAAgB;AAC/C,SAASC,CAAC,QAAQ,wBAAwB;AAC1C,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,OAAO,KAAKC,EAAE,MAAM,iBAAiB;AACrC,SAASC,YAAY;AAErBL,QAAQ,CAAC,sBAAsB,EAAE,MAAM;EACrCE,EAAE,CAAC,sCAAsC,EAAE,MAAM;IAC/C,MAAMI,GAAG,GAAAC,iBAAA,CACNH,EAAE,CAACI,QAAQ;MAAA,IAACC,WAAWA,CAAA;QAAA,OAAE,CAAAF,iBAAA,CAAEV,KAAK;UAAAa,QAAA;QAAA,GAA4B;MAAA;IAAA,EAC9D;IACD,MAAMC,GAAG,GAAGN,YAAY,CACtB,CAAAE,iBAAA,CACGH,EAAE,CAACQ,UAAU;MAACC,IAAI;MAAA,IAAAH,SAAA;QAAA,OAAAH,iBAAA,CAChBH,EAAE,CAACU,oBAAoB;UAACC,IAAI;UAAQT,GAAG,EAAEA;QAAG;MAAA;IAAA,GAEhD,EACD;MAAEU,SAAS,EAAE,CAACb,iBAAiB;IAAE,CACnC,CAAC;IAEDF,MAAM,CAACU,GAAG,CAAC,CAACM,UAAU,CACpBlB,CAAC;AACP;AAC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