Commit 51211a0
feat(python): idiomatic capitalization for structs (#586)
This change addresses 4 issues:
- Structs now use idiomatic (snake_case) capitalization of fields
(instead of JSII-inherited camelCase).
- IDE support -- replace TypedDict usage with regular classes. This
makes it so that we can't use dicts anymore, but mypy support in
IDEs wasn't great and by using POPOs (Plain Old Python Objects)
IDEs get their support back.
- Structs in a variadic argument use to be incorrectly lifted to
keyword arguments, this no longer happens.
- Stop emitting "Stable" stabilities in docstrings, "Stable" is implied.
In order to make this change, I've had to make `jsii-pacmak` depend on
`jsii-reflect`. This is the proper layering of libraries anyway, since
`jsii-reflect` adds much-needed--and otherwise
duplicated--interpretation of the spec.
Complete refactoring of `jsii-pacmak` to build on `jsii-reflect` is too
much work right now, however, so I've added "escape hatching" where
generators can take advantage of the power of jsii-reflect if they want
to, but most of the code still works on the raw spec level.
Added a refactoring where we load the assembly once and reuse the same
instance for all generators, instead of loading the assembly for every
generator. Assembly-loading, especially with a lot of dependencies, takes
a non-negligible amount of time, so this has the side effect of making
the packaging step faster (shaves off 100 packages * 3 targets * a
couple of seconds).
Fixes #537
Fixes #577
Fixes #578
Fixes #5881 parent c9fdecc commit 51211a0
File tree
43 files changed
+3898
-2143
lines changed- packages
- codemaker
- lib
- test
- jsii-calc
- lib
- test
- jsii-pacmak
- bin
- lib
- targets
- test
- expected.jsii-calc-base/python/src/scope/jsii_calc_base
- expected.jsii-calc-lib/python/src/scope/jsii_calc_lib
- expected.jsii-calc
- dotnet/Amazon.JSII.Tests.CalculatorPackageId
- Amazon/JSII/Tests/CalculatorNamespace
- java/src/main/java/software/amazon/jsii/tests/calculator
- python/src/jsii_calc
- sphinx
- jsii-python-runtime
- src/jsii
- _kernel
- providers
- tests
- jsii-reflect/test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
43 files changed
+3898
-2143
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
14 | 31 | | |
15 | 32 | | |
16 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1741 | 1741 | | |
1742 | 1742 | | |
1743 | 1743 | | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7150 | 7150 | | |
7151 | 7151 | | |
7152 | 7152 | | |
| 7153 | + | |
| 7154 | + | |
| 7155 | + | |
| 7156 | + | |
| 7157 | + | |
| 7158 | + | |
| 7159 | + | |
| 7160 | + | |
| 7161 | + | |
| 7162 | + | |
| 7163 | + | |
| 7164 | + | |
| 7165 | + | |
| 7166 | + | |
| 7167 | + | |
| 7168 | + | |
| 7169 | + | |
| 7170 | + | |
| 7171 | + | |
| 7172 | + | |
| 7173 | + | |
| 7174 | + | |
| 7175 | + | |
| 7176 | + | |
| 7177 | + | |
| 7178 | + | |
| 7179 | + | |
| 7180 | + | |
| 7181 | + | |
| 7182 | + | |
| 7183 | + | |
| 7184 | + | |
| 7185 | + | |
| 7186 | + | |
| 7187 | + | |
| 7188 | + | |
| 7189 | + | |
| 7190 | + | |
| 7191 | + | |
| 7192 | + | |
| 7193 | + | |
| 7194 | + | |
| 7195 | + | |
| 7196 | + | |
| 7197 | + | |
| 7198 | + | |
| 7199 | + | |
| 7200 | + | |
| 7201 | + | |
7153 | 7202 | | |
7154 | 7203 | | |
7155 | 7204 | | |
| |||
7756 | 7805 | | |
7757 | 7806 | | |
7758 | 7807 | | |
| 7808 | + | |
| 7809 | + | |
| 7810 | + | |
| 7811 | + | |
| 7812 | + | |
| 7813 | + | |
| 7814 | + | |
| 7815 | + | |
| 7816 | + | |
| 7817 | + | |
| 7818 | + | |
| 7819 | + | |
| 7820 | + | |
| 7821 | + | |
| 7822 | + | |
| 7823 | + | |
| 7824 | + | |
| 7825 | + | |
| 7826 | + | |
| 7827 | + | |
| 7828 | + | |
| 7829 | + | |
| 7830 | + | |
| 7831 | + | |
| 7832 | + | |
| 7833 | + | |
| 7834 | + | |
| 7835 | + | |
| 7836 | + | |
| 7837 | + | |
| 7838 | + | |
| 7839 | + | |
| 7840 | + | |
| 7841 | + | |
| 7842 | + | |
| 7843 | + | |
| 7844 | + | |
| 7845 | + | |
| 7846 | + | |
| 7847 | + | |
| 7848 | + | |
| 7849 | + | |
| 7850 | + | |
| 7851 | + | |
| 7852 | + | |
| 7853 | + | |
| 7854 | + | |
| 7855 | + | |
| 7856 | + | |
| 7857 | + | |
| 7858 | + | |
| 7859 | + | |
| 7860 | + | |
| 7861 | + | |
| 7862 | + | |
| 7863 | + | |
| 7864 | + | |
| 7865 | + | |
| 7866 | + | |
| 7867 | + | |
| 7868 | + | |
| 7869 | + | |
| 7870 | + | |
| 7871 | + | |
| 7872 | + | |
| 7873 | + | |
| 7874 | + | |
| 7875 | + | |
| 7876 | + | |
| 7877 | + | |
| 7878 | + | |
| 7879 | + | |
| 7880 | + | |
| 7881 | + | |
| 7882 | + | |
| 7883 | + | |
| 7884 | + | |
| 7885 | + | |
| 7886 | + | |
| 7887 | + | |
| 7888 | + | |
7759 | 7889 | | |
7760 | 7890 | | |
7761 | 7891 | | |
| |||
8104 | 8234 | | |
8105 | 8235 | | |
8106 | 8236 | | |
| 8237 | + | |
| 8238 | + | |
| 8239 | + | |
| 8240 | + | |
| 8241 | + | |
| 8242 | + | |
| 8243 | + | |
| 8244 | + | |
| 8245 | + | |
| 8246 | + | |
| 8247 | + | |
| 8248 | + | |
| 8249 | + | |
| 8250 | + | |
| 8251 | + | |
| 8252 | + | |
| 8253 | + | |
| 8254 | + | |
| 8255 | + | |
| 8256 | + | |
| 8257 | + | |
| 8258 | + | |
| 8259 | + | |
| 8260 | + | |
| 8261 | + | |
| 8262 | + | |
| 8263 | + | |
| 8264 | + | |
| 8265 | + | |
| 8266 | + | |
| 8267 | + | |
| 8268 | + | |
| 8269 | + | |
| 8270 | + | |
| 8271 | + | |
| 8272 | + | |
| 8273 | + | |
| 8274 | + | |
| 8275 | + | |
| 8276 | + | |
| 8277 | + | |
| 8278 | + | |
| 8279 | + | |
| 8280 | + | |
| 8281 | + | |
| 8282 | + | |
| 8283 | + | |
| 8284 | + | |
| 8285 | + | |
| 8286 | + | |
| 8287 | + | |
| 8288 | + | |
| 8289 | + | |
| 8290 | + | |
| 8291 | + | |
| 8292 | + | |
| 8293 | + | |
| 8294 | + | |
| 8295 | + | |
| 8296 | + | |
| 8297 | + | |
| 8298 | + | |
| 8299 | + | |
| 8300 | + | |
| 8301 | + | |
| 8302 | + | |
| 8303 | + | |
| 8304 | + | |
| 8305 | + | |
| 8306 | + | |
| 8307 | + | |
| 8308 | + | |
| 8309 | + | |
| 8310 | + | |
8107 | 8311 | | |
8108 | 8312 | | |
8109 | 8313 | | |
| |||
8851 | 9055 | | |
8852 | 9056 | | |
8853 | 9057 | | |
8854 | | - | |
| 9058 | + | |
8855 | 9059 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
| |||
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
147 | | - | |
| 152 | + | |
148 | 153 | | |
149 | 154 | | |
150 | 155 | | |
| |||
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
162 | | - | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | 170 | | |
| |||
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
| 177 | + | |
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
| |||
0 commit comments