Commit cfc185c
authored
Refactor, update to Pydantic v2 (#65)
Previously confection did three tree operations simultaneously (in the registry._fill method):
* Build a version of the config with defaults in-place
* Build a modified version suitable for validation
* Build an output version with promises resolved
The fact that all three were being built at once made the code quite hard to update for Pydantic 2, and just difficult to work with in general. I've therefore refactored the code so that these are separate processes that apply to the whole tree at once.
A bonus of this is that we now build a model for the whole config and validate against that, which means all the validation errors for the config should come in at once, instead of only getting validation errors for one promise at a time.
Updating to Pydantic v2 will let spaCy finally support Python 3.13.1 parent 81ac158 commit cfc185c
File tree
11 files changed
+2223
-1764
lines changed- .github/workflows
- confection
- tests
11 files changed
+2223
-1764
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 42 | + | |
56 | 43 | | |
57 | 44 | | |
58 | 45 | | |
| |||
71 | 58 | | |
72 | 59 | | |
73 | 60 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 61 | | |
86 | 62 | | |
87 | 63 | | |
| |||
100 | 76 | | |
101 | 77 | | |
102 | 78 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 79 | | |
114 | 80 | | |
115 | 81 | | |
| |||
0 commit comments