codeshift 0.3.3__py3-none-any.whl → 0.3.4__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.
- codeshift/cli/commands/apply.py +24 -2
- codeshift/cli/package_manager.py +102 -0
- codeshift/knowledge/generator.py +11 -1
- codeshift/knowledge_base/libraries/aiohttp.yaml +186 -0
- codeshift/knowledge_base/libraries/attrs.yaml +181 -0
- codeshift/knowledge_base/libraries/celery.yaml +244 -0
- codeshift/knowledge_base/libraries/click.yaml +195 -0
- codeshift/knowledge_base/libraries/django.yaml +355 -0
- codeshift/knowledge_base/libraries/flask.yaml +270 -0
- codeshift/knowledge_base/libraries/httpx.yaml +183 -0
- codeshift/knowledge_base/libraries/marshmallow.yaml +238 -0
- codeshift/knowledge_base/libraries/numpy.yaml +429 -0
- codeshift/knowledge_base/libraries/pytest.yaml +192 -0
- codeshift/knowledge_base/libraries/sqlalchemy.yaml +2 -1
- codeshift/migrator/engine.py +60 -0
- codeshift/migrator/transforms/__init__.py +2 -0
- codeshift/migrator/transforms/aiohttp_transformer.py +608 -0
- codeshift/migrator/transforms/attrs_transformer.py +570 -0
- codeshift/migrator/transforms/celery_transformer.py +546 -0
- codeshift/migrator/transforms/click_transformer.py +526 -0
- codeshift/migrator/transforms/django_transformer.py +852 -0
- codeshift/migrator/transforms/fastapi_transformer.py +12 -7
- codeshift/migrator/transforms/flask_transformer.py +505 -0
- codeshift/migrator/transforms/httpx_transformer.py +419 -0
- codeshift/migrator/transforms/marshmallow_transformer.py +515 -0
- codeshift/migrator/transforms/numpy_transformer.py +413 -0
- codeshift/migrator/transforms/pydantic_v1_to_v2.py +53 -8
- codeshift/migrator/transforms/pytest_transformer.py +351 -0
- codeshift/migrator/transforms/requests_transformer.py +74 -1
- codeshift/migrator/transforms/sqlalchemy_transformer.py +692 -39
- {codeshift-0.3.3.dist-info → codeshift-0.3.4.dist-info}/METADATA +46 -4
- {codeshift-0.3.3.dist-info → codeshift-0.3.4.dist-info}/RECORD +36 -15
- {codeshift-0.3.3.dist-info → codeshift-0.3.4.dist-info}/WHEEL +0 -0
- {codeshift-0.3.3.dist-info → codeshift-0.3.4.dist-info}/entry_points.txt +0 -0
- {codeshift-0.3.3.dist-info → codeshift-0.3.4.dist-info}/licenses/LICENSE +0 -0
- {codeshift-0.3.3.dist-info → codeshift-0.3.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
# NumPy Knowledge Base
|
|
2
|
+
# Breaking changes from 1.x to 2.0
|
|
3
|
+
|
|
4
|
+
name: numpy
|
|
5
|
+
display_name: NumPy
|
|
6
|
+
description: Fundamental package for scientific computing in Python
|
|
7
|
+
migration_guide_url: https://numpy.org/doc/stable/numpy_2_0_migration_guide.html
|
|
8
|
+
|
|
9
|
+
supported_migrations:
|
|
10
|
+
- from: "1.0"
|
|
11
|
+
to: "2.0"
|
|
12
|
+
|
|
13
|
+
breaking_changes:
|
|
14
|
+
# Type alias removals - These aliases conflicted with Python builtins
|
|
15
|
+
- symbol: "numpy.bool"
|
|
16
|
+
change_type: removed
|
|
17
|
+
severity: high
|
|
18
|
+
from_version: "1.0"
|
|
19
|
+
to_version: "2.0"
|
|
20
|
+
description: "numpy.bool removed, use numpy.bool_ or Python bool"
|
|
21
|
+
replacement: "numpy.bool_"
|
|
22
|
+
has_deterministic_transform: true
|
|
23
|
+
transform_name: bool_to_bool_
|
|
24
|
+
notes: "Type alias that shadowed Python builtin bool"
|
|
25
|
+
|
|
26
|
+
- symbol: "numpy.int"
|
|
27
|
+
change_type: removed
|
|
28
|
+
severity: high
|
|
29
|
+
from_version: "1.0"
|
|
30
|
+
to_version: "2.0"
|
|
31
|
+
description: "numpy.int removed, use numpy.int_ or numpy.intp"
|
|
32
|
+
replacement: "numpy.int_"
|
|
33
|
+
has_deterministic_transform: true
|
|
34
|
+
transform_name: int_to_int_
|
|
35
|
+
notes: "Type alias that shadowed Python builtin int"
|
|
36
|
+
|
|
37
|
+
- symbol: "numpy.float"
|
|
38
|
+
change_type: removed
|
|
39
|
+
severity: high
|
|
40
|
+
from_version: "1.0"
|
|
41
|
+
to_version: "2.0"
|
|
42
|
+
description: "numpy.float removed, use numpy.float64"
|
|
43
|
+
replacement: "numpy.float64"
|
|
44
|
+
has_deterministic_transform: true
|
|
45
|
+
transform_name: float_to_float64
|
|
46
|
+
notes: "Type alias that shadowed Python builtin float"
|
|
47
|
+
|
|
48
|
+
- symbol: "numpy.complex"
|
|
49
|
+
change_type: removed
|
|
50
|
+
severity: high
|
|
51
|
+
from_version: "1.0"
|
|
52
|
+
to_version: "2.0"
|
|
53
|
+
description: "numpy.complex removed, use numpy.complex128"
|
|
54
|
+
replacement: "numpy.complex128"
|
|
55
|
+
has_deterministic_transform: true
|
|
56
|
+
transform_name: complex_to_complex128
|
|
57
|
+
notes: "Type alias that shadowed Python builtin complex"
|
|
58
|
+
|
|
59
|
+
- symbol: "numpy.object"
|
|
60
|
+
change_type: removed
|
|
61
|
+
severity: high
|
|
62
|
+
from_version: "1.0"
|
|
63
|
+
to_version: "2.0"
|
|
64
|
+
description: "numpy.object removed, use numpy.object_"
|
|
65
|
+
replacement: "numpy.object_"
|
|
66
|
+
has_deterministic_transform: true
|
|
67
|
+
transform_name: object_to_object_
|
|
68
|
+
notes: "Type alias that shadowed Python builtin object"
|
|
69
|
+
|
|
70
|
+
- symbol: "numpy.str"
|
|
71
|
+
change_type: removed
|
|
72
|
+
severity: high
|
|
73
|
+
from_version: "1.0"
|
|
74
|
+
to_version: "2.0"
|
|
75
|
+
description: "numpy.str removed, use numpy.str_"
|
|
76
|
+
replacement: "numpy.str_"
|
|
77
|
+
has_deterministic_transform: true
|
|
78
|
+
transform_name: str_to_str_
|
|
79
|
+
notes: "Type alias that shadowed Python builtin str"
|
|
80
|
+
|
|
81
|
+
- symbol: "numpy.unicode_"
|
|
82
|
+
change_type: renamed
|
|
83
|
+
severity: medium
|
|
84
|
+
from_version: "1.0"
|
|
85
|
+
to_version: "2.0"
|
|
86
|
+
description: "numpy.unicode_ renamed to numpy.str_"
|
|
87
|
+
replacement: "numpy.str_"
|
|
88
|
+
has_deterministic_transform: true
|
|
89
|
+
transform_name: unicode_to_str_
|
|
90
|
+
|
|
91
|
+
- symbol: "numpy.string_"
|
|
92
|
+
change_type: renamed
|
|
93
|
+
severity: medium
|
|
94
|
+
from_version: "1.0"
|
|
95
|
+
to_version: "2.0"
|
|
96
|
+
description: "numpy.string_ renamed to numpy.bytes_"
|
|
97
|
+
replacement: "numpy.bytes_"
|
|
98
|
+
has_deterministic_transform: true
|
|
99
|
+
transform_name: string_to_bytes_
|
|
100
|
+
|
|
101
|
+
# Additional type alias removals
|
|
102
|
+
- symbol: "numpy.float_"
|
|
103
|
+
change_type: removed
|
|
104
|
+
severity: medium
|
|
105
|
+
from_version: "1.0"
|
|
106
|
+
to_version: "2.0"
|
|
107
|
+
description: "numpy.float_ removed, use numpy.float64"
|
|
108
|
+
replacement: "numpy.float64"
|
|
109
|
+
has_deterministic_transform: true
|
|
110
|
+
transform_name: float__to_float64
|
|
111
|
+
|
|
112
|
+
- symbol: "numpy.complex_"
|
|
113
|
+
change_type: removed
|
|
114
|
+
severity: medium
|
|
115
|
+
from_version: "1.0"
|
|
116
|
+
to_version: "2.0"
|
|
117
|
+
description: "numpy.complex_ removed, use numpy.complex128"
|
|
118
|
+
replacement: "numpy.complex128"
|
|
119
|
+
has_deterministic_transform: true
|
|
120
|
+
transform_name: complex__to_complex128
|
|
121
|
+
|
|
122
|
+
- symbol: "numpy.cfloat"
|
|
123
|
+
change_type: removed
|
|
124
|
+
severity: medium
|
|
125
|
+
from_version: "1.0"
|
|
126
|
+
to_version: "2.0"
|
|
127
|
+
description: "numpy.cfloat removed, use numpy.complex128"
|
|
128
|
+
replacement: "numpy.complex128"
|
|
129
|
+
has_deterministic_transform: true
|
|
130
|
+
transform_name: cfloat_to_complex128
|
|
131
|
+
|
|
132
|
+
- symbol: "numpy.singlecomplex"
|
|
133
|
+
change_type: removed
|
|
134
|
+
severity: low
|
|
135
|
+
from_version: "1.0"
|
|
136
|
+
to_version: "2.0"
|
|
137
|
+
description: "numpy.singlecomplex removed, use numpy.complex64"
|
|
138
|
+
replacement: "numpy.complex64"
|
|
139
|
+
has_deterministic_transform: true
|
|
140
|
+
transform_name: singlecomplex_to_complex64
|
|
141
|
+
|
|
142
|
+
- symbol: "numpy.longfloat"
|
|
143
|
+
change_type: removed
|
|
144
|
+
severity: low
|
|
145
|
+
from_version: "1.0"
|
|
146
|
+
to_version: "2.0"
|
|
147
|
+
description: "numpy.longfloat removed, use numpy.longdouble"
|
|
148
|
+
replacement: "numpy.longdouble"
|
|
149
|
+
has_deterministic_transform: true
|
|
150
|
+
transform_name: longfloat_to_longdouble
|
|
151
|
+
|
|
152
|
+
- symbol: "numpy.longcomplex"
|
|
153
|
+
change_type: removed
|
|
154
|
+
severity: low
|
|
155
|
+
from_version: "1.0"
|
|
156
|
+
to_version: "2.0"
|
|
157
|
+
description: "numpy.longcomplex removed, use numpy.clongdouble"
|
|
158
|
+
replacement: "numpy.clongdouble"
|
|
159
|
+
has_deterministic_transform: true
|
|
160
|
+
transform_name: longcomplex_to_clongdouble
|
|
161
|
+
|
|
162
|
+
- symbol: "numpy.clongfloat"
|
|
163
|
+
change_type: removed
|
|
164
|
+
severity: low
|
|
165
|
+
from_version: "1.0"
|
|
166
|
+
to_version: "2.0"
|
|
167
|
+
description: "numpy.clongfloat removed, use numpy.clongdouble"
|
|
168
|
+
replacement: "numpy.clongdouble"
|
|
169
|
+
has_deterministic_transform: true
|
|
170
|
+
transform_name: clongfloat_to_clongdouble
|
|
171
|
+
|
|
172
|
+
# Function removals and renames
|
|
173
|
+
- symbol: "numpy.alltrue"
|
|
174
|
+
change_type: removed
|
|
175
|
+
severity: high
|
|
176
|
+
from_version: "1.0"
|
|
177
|
+
to_version: "2.0"
|
|
178
|
+
description: "numpy.alltrue() removed, use numpy.all()"
|
|
179
|
+
replacement: "numpy.all()"
|
|
180
|
+
has_deterministic_transform: true
|
|
181
|
+
transform_name: alltrue_to_all
|
|
182
|
+
|
|
183
|
+
- symbol: "numpy.sometrue"
|
|
184
|
+
change_type: removed
|
|
185
|
+
severity: high
|
|
186
|
+
from_version: "1.0"
|
|
187
|
+
to_version: "2.0"
|
|
188
|
+
description: "numpy.sometrue() removed, use numpy.any()"
|
|
189
|
+
replacement: "numpy.any()"
|
|
190
|
+
has_deterministic_transform: true
|
|
191
|
+
transform_name: sometrue_to_any
|
|
192
|
+
|
|
193
|
+
- symbol: "numpy.product"
|
|
194
|
+
change_type: removed
|
|
195
|
+
severity: high
|
|
196
|
+
from_version: "1.0"
|
|
197
|
+
to_version: "2.0"
|
|
198
|
+
description: "numpy.product() removed, use numpy.prod()"
|
|
199
|
+
replacement: "numpy.prod()"
|
|
200
|
+
has_deterministic_transform: true
|
|
201
|
+
transform_name: product_to_prod
|
|
202
|
+
|
|
203
|
+
- symbol: "numpy.cumproduct"
|
|
204
|
+
change_type: removed
|
|
205
|
+
severity: high
|
|
206
|
+
from_version: "1.0"
|
|
207
|
+
to_version: "2.0"
|
|
208
|
+
description: "numpy.cumproduct() removed, use numpy.cumprod()"
|
|
209
|
+
replacement: "numpy.cumprod()"
|
|
210
|
+
has_deterministic_transform: true
|
|
211
|
+
transform_name: cumproduct_to_cumprod
|
|
212
|
+
|
|
213
|
+
- symbol: "numpy.trapz"
|
|
214
|
+
change_type: renamed
|
|
215
|
+
severity: medium
|
|
216
|
+
from_version: "1.0"
|
|
217
|
+
to_version: "2.0"
|
|
218
|
+
description: "numpy.trapz() renamed to numpy.trapezoid()"
|
|
219
|
+
replacement: "numpy.trapezoid()"
|
|
220
|
+
has_deterministic_transform: true
|
|
221
|
+
transform_name: trapz_to_trapezoid
|
|
222
|
+
|
|
223
|
+
- symbol: "numpy.in1d"
|
|
224
|
+
change_type: renamed
|
|
225
|
+
severity: medium
|
|
226
|
+
from_version: "1.0"
|
|
227
|
+
to_version: "2.0"
|
|
228
|
+
description: "numpy.in1d() renamed to numpy.isin()"
|
|
229
|
+
replacement: "numpy.isin()"
|
|
230
|
+
has_deterministic_transform: true
|
|
231
|
+
transform_name: in1d_to_isin
|
|
232
|
+
|
|
233
|
+
- symbol: "numpy.row_stack"
|
|
234
|
+
change_type: renamed
|
|
235
|
+
severity: low
|
|
236
|
+
from_version: "1.0"
|
|
237
|
+
to_version: "2.0"
|
|
238
|
+
description: "numpy.row_stack() renamed to numpy.vstack()"
|
|
239
|
+
replacement: "numpy.vstack()"
|
|
240
|
+
has_deterministic_transform: true
|
|
241
|
+
transform_name: row_stack_to_vstack
|
|
242
|
+
|
|
243
|
+
- symbol: "numpy.msort"
|
|
244
|
+
change_type: removed
|
|
245
|
+
severity: medium
|
|
246
|
+
from_version: "1.0"
|
|
247
|
+
to_version: "2.0"
|
|
248
|
+
description: "numpy.msort() removed, use numpy.sort(a, axis=0)"
|
|
249
|
+
replacement: "numpy.sort(a, axis=0)"
|
|
250
|
+
has_deterministic_transform: true
|
|
251
|
+
transform_name: msort_to_sort_axis0
|
|
252
|
+
notes: "msort(a) was equivalent to sort(a, axis=0)"
|
|
253
|
+
|
|
254
|
+
# Constant removals
|
|
255
|
+
- symbol: "numpy.Inf"
|
|
256
|
+
change_type: removed
|
|
257
|
+
severity: medium
|
|
258
|
+
from_version: "1.0"
|
|
259
|
+
to_version: "2.0"
|
|
260
|
+
description: "numpy.Inf removed, use numpy.inf"
|
|
261
|
+
replacement: "numpy.inf"
|
|
262
|
+
has_deterministic_transform: true
|
|
263
|
+
transform_name: Inf_to_inf
|
|
264
|
+
|
|
265
|
+
- symbol: "numpy.Infinity"
|
|
266
|
+
change_type: removed
|
|
267
|
+
severity: medium
|
|
268
|
+
from_version: "1.0"
|
|
269
|
+
to_version: "2.0"
|
|
270
|
+
description: "numpy.Infinity removed, use numpy.inf"
|
|
271
|
+
replacement: "numpy.inf"
|
|
272
|
+
has_deterministic_transform: true
|
|
273
|
+
transform_name: Infinity_to_inf
|
|
274
|
+
|
|
275
|
+
- symbol: "numpy.infty"
|
|
276
|
+
change_type: removed
|
|
277
|
+
severity: medium
|
|
278
|
+
from_version: "1.0"
|
|
279
|
+
to_version: "2.0"
|
|
280
|
+
description: "numpy.infty removed, use numpy.inf"
|
|
281
|
+
replacement: "numpy.inf"
|
|
282
|
+
has_deterministic_transform: true
|
|
283
|
+
transform_name: infty_to_inf
|
|
284
|
+
|
|
285
|
+
- symbol: "numpy.NaN"
|
|
286
|
+
change_type: removed
|
|
287
|
+
severity: medium
|
|
288
|
+
from_version: "1.0"
|
|
289
|
+
to_version: "2.0"
|
|
290
|
+
description: "numpy.NaN removed, use numpy.nan"
|
|
291
|
+
replacement: "numpy.nan"
|
|
292
|
+
has_deterministic_transform: true
|
|
293
|
+
transform_name: NaN_to_nan
|
|
294
|
+
|
|
295
|
+
- symbol: "numpy.PINF"
|
|
296
|
+
change_type: removed
|
|
297
|
+
severity: low
|
|
298
|
+
from_version: "1.0"
|
|
299
|
+
to_version: "2.0"
|
|
300
|
+
description: "numpy.PINF removed, use numpy.inf"
|
|
301
|
+
replacement: "numpy.inf"
|
|
302
|
+
has_deterministic_transform: true
|
|
303
|
+
transform_name: PINF_to_inf
|
|
304
|
+
|
|
305
|
+
- symbol: "numpy.NINF"
|
|
306
|
+
change_type: removed
|
|
307
|
+
severity: low
|
|
308
|
+
from_version: "1.0"
|
|
309
|
+
to_version: "2.0"
|
|
310
|
+
description: "numpy.NINF removed, use -numpy.inf"
|
|
311
|
+
replacement: "-numpy.inf"
|
|
312
|
+
has_deterministic_transform: true
|
|
313
|
+
transform_name: NINF_to_neg_inf
|
|
314
|
+
|
|
315
|
+
- symbol: "numpy.PZERO"
|
|
316
|
+
change_type: removed
|
|
317
|
+
severity: low
|
|
318
|
+
from_version: "1.0"
|
|
319
|
+
to_version: "2.0"
|
|
320
|
+
description: "numpy.PZERO removed, use 0.0"
|
|
321
|
+
replacement: "0.0"
|
|
322
|
+
has_deterministic_transform: true
|
|
323
|
+
transform_name: PZERO_to_zero
|
|
324
|
+
|
|
325
|
+
- symbol: "numpy.NZERO"
|
|
326
|
+
change_type: removed
|
|
327
|
+
severity: low
|
|
328
|
+
from_version: "1.0"
|
|
329
|
+
to_version: "2.0"
|
|
330
|
+
description: "numpy.NZERO removed, use -0.0"
|
|
331
|
+
replacement: "-0.0"
|
|
332
|
+
has_deterministic_transform: true
|
|
333
|
+
transform_name: NZERO_to_neg_zero
|
|
334
|
+
|
|
335
|
+
# Removed utility functions
|
|
336
|
+
- symbol: "numpy.asfarray"
|
|
337
|
+
change_type: removed
|
|
338
|
+
severity: medium
|
|
339
|
+
from_version: "1.0"
|
|
340
|
+
to_version: "2.0"
|
|
341
|
+
description: "numpy.asfarray() removed, use numpy.asarray(a, dtype=float)"
|
|
342
|
+
replacement: "numpy.asarray(a, dtype=float)"
|
|
343
|
+
has_deterministic_transform: true
|
|
344
|
+
transform_name: asfarray_to_asarray
|
|
345
|
+
notes: "asfarray converted input to float array"
|
|
346
|
+
|
|
347
|
+
- symbol: "numpy.issubsctype"
|
|
348
|
+
change_type: removed
|
|
349
|
+
severity: low
|
|
350
|
+
from_version: "1.0"
|
|
351
|
+
to_version: "2.0"
|
|
352
|
+
description: "numpy.issubsctype() removed, use numpy.issubdtype()"
|
|
353
|
+
replacement: "numpy.issubdtype()"
|
|
354
|
+
has_deterministic_transform: true
|
|
355
|
+
transform_name: issubsctype_to_issubdtype
|
|
356
|
+
|
|
357
|
+
- symbol: "numpy.issubclass_"
|
|
358
|
+
change_type: removed
|
|
359
|
+
severity: low
|
|
360
|
+
from_version: "1.0"
|
|
361
|
+
to_version: "2.0"
|
|
362
|
+
description: "numpy.issubclass_() removed, use builtin issubclass()"
|
|
363
|
+
replacement: "issubclass()"
|
|
364
|
+
has_deterministic_transform: true
|
|
365
|
+
transform_name: issubclass__to_builtin
|
|
366
|
+
|
|
367
|
+
# Matrix deprecation
|
|
368
|
+
- symbol: "numpy.matrix"
|
|
369
|
+
change_type: deprecated
|
|
370
|
+
severity: high
|
|
371
|
+
from_version: "1.0"
|
|
372
|
+
to_version: "2.0"
|
|
373
|
+
description: "numpy.matrix is deprecated, use numpy.ndarray with @ operator for matrix multiplication"
|
|
374
|
+
replacement: "numpy.ndarray"
|
|
375
|
+
has_deterministic_transform: false
|
|
376
|
+
notes: "Migration requires significant code changes, use np.array and @ for matrix multiply"
|
|
377
|
+
|
|
378
|
+
- symbol: "numpy.mat"
|
|
379
|
+
change_type: deprecated
|
|
380
|
+
severity: high
|
|
381
|
+
from_version: "1.0"
|
|
382
|
+
to_version: "2.0"
|
|
383
|
+
description: "numpy.mat is deprecated, use numpy.asarray() instead"
|
|
384
|
+
replacement: "numpy.asarray()"
|
|
385
|
+
has_deterministic_transform: false
|
|
386
|
+
notes: "Migration requires significant code changes"
|
|
387
|
+
|
|
388
|
+
# ndarray method removals
|
|
389
|
+
- symbol: "ndarray.newbyteorder"
|
|
390
|
+
change_type: removed
|
|
391
|
+
severity: low
|
|
392
|
+
from_version: "1.0"
|
|
393
|
+
to_version: "2.0"
|
|
394
|
+
description: "ndarray.newbyteorder() removed, use arr.view(arr.dtype.newbyteorder(order))"
|
|
395
|
+
replacement: "arr.view(arr.dtype.newbyteorder(order))"
|
|
396
|
+
has_deterministic_transform: false
|
|
397
|
+
notes: "Requires understanding of the order argument"
|
|
398
|
+
|
|
399
|
+
- symbol: "ndarray.ptp"
|
|
400
|
+
change_type: removed
|
|
401
|
+
severity: low
|
|
402
|
+
from_version: "1.0"
|
|
403
|
+
to_version: "2.0"
|
|
404
|
+
description: "ndarray.ptp() method removed, use numpy.ptp(arr) function"
|
|
405
|
+
replacement: "numpy.ptp(arr)"
|
|
406
|
+
has_deterministic_transform: false
|
|
407
|
+
notes: "ptp = peak to peak (max - min)"
|
|
408
|
+
|
|
409
|
+
# Namespace changes
|
|
410
|
+
- symbol: "numpy.core"
|
|
411
|
+
change_type: removed
|
|
412
|
+
severity: low
|
|
413
|
+
from_version: "1.0"
|
|
414
|
+
to_version: "2.0"
|
|
415
|
+
description: "numpy.core namespace made private, access functions through main numpy namespace"
|
|
416
|
+
replacement: "numpy"
|
|
417
|
+
has_deterministic_transform: false
|
|
418
|
+
notes: "numpy.core is now numpy._core (private)"
|
|
419
|
+
|
|
420
|
+
# Random module changes
|
|
421
|
+
- symbol: "numpy.random.random_integers"
|
|
422
|
+
change_type: removed
|
|
423
|
+
severity: medium
|
|
424
|
+
from_version: "1.0"
|
|
425
|
+
to_version: "2.0"
|
|
426
|
+
description: "numpy.random.random_integers() removed, use numpy.random.randint()"
|
|
427
|
+
replacement: "numpy.random.randint(low, high+1)"
|
|
428
|
+
has_deterministic_transform: false
|
|
429
|
+
notes: "random_integers included high endpoint, randint excludes it"
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Pytest Knowledge Base
|
|
2
|
+
# Breaking changes from 6.x to 7.x/8.x
|
|
3
|
+
|
|
4
|
+
name: pytest
|
|
5
|
+
display_name: Pytest
|
|
6
|
+
description: Python testing framework
|
|
7
|
+
migration_guide_url: https://docs.pytest.org/en/stable/deprecations.html
|
|
8
|
+
|
|
9
|
+
supported_migrations:
|
|
10
|
+
- from: "6.0"
|
|
11
|
+
to: "7.0"
|
|
12
|
+
- from: "7.0"
|
|
13
|
+
to: "8.0"
|
|
14
|
+
- from: "6.0"
|
|
15
|
+
to: "8.0"
|
|
16
|
+
|
|
17
|
+
breaking_changes:
|
|
18
|
+
# yield_fixture deprecation (removed in 8.0)
|
|
19
|
+
- symbol: "@pytest.yield_fixture"
|
|
20
|
+
change_type: renamed
|
|
21
|
+
severity: high
|
|
22
|
+
from_version: "6.0"
|
|
23
|
+
to_version: "8.0"
|
|
24
|
+
description: "@pytest.yield_fixture is deprecated and removed, use @pytest.fixture instead"
|
|
25
|
+
replacement: "@pytest.fixture"
|
|
26
|
+
has_deterministic_transform: true
|
|
27
|
+
transform_name: yield_fixture_to_fixture
|
|
28
|
+
notes: "yield_fixture has been an alias for fixture since pytest 3.0"
|
|
29
|
+
|
|
30
|
+
# tmpdir to tmp_path fixture preference
|
|
31
|
+
- symbol: "tmpdir"
|
|
32
|
+
change_type: deprecated
|
|
33
|
+
severity: medium
|
|
34
|
+
from_version: "6.0"
|
|
35
|
+
to_version: "8.0"
|
|
36
|
+
description: "tmpdir fixture (py.path.local) is deprecated, use tmp_path (pathlib.Path) instead"
|
|
37
|
+
replacement: "tmp_path"
|
|
38
|
+
has_deterministic_transform: true
|
|
39
|
+
transform_name: tmpdir_to_tmp_path
|
|
40
|
+
notes: "Requires updating code that uses py.path.local methods to pathlib.Path methods"
|
|
41
|
+
|
|
42
|
+
# tmpdir_factory to tmp_path_factory
|
|
43
|
+
- symbol: "tmpdir_factory"
|
|
44
|
+
change_type: deprecated
|
|
45
|
+
severity: medium
|
|
46
|
+
from_version: "6.0"
|
|
47
|
+
to_version: "8.0"
|
|
48
|
+
description: "tmpdir_factory fixture is deprecated, use tmp_path_factory instead"
|
|
49
|
+
replacement: "tmp_path_factory"
|
|
50
|
+
has_deterministic_transform: true
|
|
51
|
+
transform_name: tmpdir_factory_to_tmp_path_factory
|
|
52
|
+
|
|
53
|
+
# pytest.config global removal
|
|
54
|
+
- symbol: "pytest.config"
|
|
55
|
+
change_type: removed
|
|
56
|
+
severity: high
|
|
57
|
+
from_version: "6.0"
|
|
58
|
+
to_version: "7.0"
|
|
59
|
+
description: "pytest.config global is removed, use request.config fixture instead"
|
|
60
|
+
replacement: "request.config"
|
|
61
|
+
has_deterministic_transform: false
|
|
62
|
+
notes: "Requires adding request fixture to function parameters"
|
|
63
|
+
|
|
64
|
+
# msg parameter renamed to reason
|
|
65
|
+
- symbol: "pytest.skip(msg=...)"
|
|
66
|
+
change_type: renamed
|
|
67
|
+
severity: medium
|
|
68
|
+
from_version: "7.0"
|
|
69
|
+
to_version: "8.0"
|
|
70
|
+
description: "msg parameter renamed to reason in pytest.skip(), pytest.fail(), pytest.exit()"
|
|
71
|
+
replacement: "pytest.skip(reason=...)"
|
|
72
|
+
has_deterministic_transform: true
|
|
73
|
+
transform_name: skip_msg_to_reason
|
|
74
|
+
|
|
75
|
+
- symbol: "pytest.fail(msg=...)"
|
|
76
|
+
change_type: renamed
|
|
77
|
+
severity: medium
|
|
78
|
+
from_version: "7.0"
|
|
79
|
+
to_version: "8.0"
|
|
80
|
+
description: "msg parameter renamed to reason in pytest.fail()"
|
|
81
|
+
replacement: "pytest.fail(reason=...)"
|
|
82
|
+
has_deterministic_transform: true
|
|
83
|
+
transform_name: fail_msg_to_reason
|
|
84
|
+
|
|
85
|
+
- symbol: "pytest.exit(msg=...)"
|
|
86
|
+
change_type: renamed
|
|
87
|
+
severity: medium
|
|
88
|
+
from_version: "7.0"
|
|
89
|
+
to_version: "8.0"
|
|
90
|
+
description: "msg parameter renamed to reason in pytest.exit()"
|
|
91
|
+
replacement: "pytest.exit(reason=...)"
|
|
92
|
+
has_deterministic_transform: true
|
|
93
|
+
transform_name: exit_msg_to_reason
|
|
94
|
+
|
|
95
|
+
# pytest.warns(None) removal
|
|
96
|
+
- symbol: "pytest.warns(None)"
|
|
97
|
+
change_type: removed
|
|
98
|
+
severity: medium
|
|
99
|
+
from_version: "7.0"
|
|
100
|
+
to_version: "8.0"
|
|
101
|
+
description: "pytest.warns(None) is removed, use pytest.warns() without arguments instead"
|
|
102
|
+
replacement: "pytest.warns()"
|
|
103
|
+
has_deterministic_transform: true
|
|
104
|
+
transform_name: warns_none_to_warns
|
|
105
|
+
|
|
106
|
+
# funcargnames to fixturenames
|
|
107
|
+
- symbol: "funcargnames"
|
|
108
|
+
change_type: renamed
|
|
109
|
+
severity: low
|
|
110
|
+
from_version: "6.0"
|
|
111
|
+
to_version: "7.0"
|
|
112
|
+
description: "funcargnames attribute renamed to fixturenames"
|
|
113
|
+
replacement: "fixturenames"
|
|
114
|
+
has_deterministic_transform: true
|
|
115
|
+
transform_name: funcargnames_to_fixturenames
|
|
116
|
+
|
|
117
|
+
# Node.fspath to Node.path
|
|
118
|
+
- symbol: "node.fspath"
|
|
119
|
+
change_type: renamed
|
|
120
|
+
severity: medium
|
|
121
|
+
from_version: "6.0"
|
|
122
|
+
to_version: "7.0"
|
|
123
|
+
description: "Node.fspath (py.path.local) deprecated in favor of Node.path (pathlib.Path)"
|
|
124
|
+
replacement: "node.path"
|
|
125
|
+
has_deterministic_transform: true
|
|
126
|
+
transform_name: fspath_to_path
|
|
127
|
+
notes: "fspath returns py.path.local, path returns pathlib.Path"
|
|
128
|
+
|
|
129
|
+
# Hook path argument changes
|
|
130
|
+
- symbol: "pytest_collect_file(path=...)"
|
|
131
|
+
change_type: renamed
|
|
132
|
+
severity: medium
|
|
133
|
+
from_version: "7.0"
|
|
134
|
+
to_version: "8.0"
|
|
135
|
+
description: "Hook argument 'path' renamed to 'file_path' (pathlib.Path)"
|
|
136
|
+
replacement: "pytest_collect_file(file_path=...)"
|
|
137
|
+
has_deterministic_transform: true
|
|
138
|
+
transform_name: hook_path_to_file_path
|
|
139
|
+
|
|
140
|
+
- symbol: "pytest_ignore_collect(path=...)"
|
|
141
|
+
change_type: renamed
|
|
142
|
+
severity: medium
|
|
143
|
+
from_version: "7.0"
|
|
144
|
+
to_version: "8.0"
|
|
145
|
+
description: "Hook argument 'path' renamed to 'collection_path' (pathlib.Path)"
|
|
146
|
+
replacement: "pytest_ignore_collect(collection_path=...)"
|
|
147
|
+
has_deterministic_transform: true
|
|
148
|
+
transform_name: hook_path_to_collection_path
|
|
149
|
+
|
|
150
|
+
- symbol: "pytest_pycollect_makemodule(path=...)"
|
|
151
|
+
change_type: renamed
|
|
152
|
+
severity: medium
|
|
153
|
+
from_version: "7.0"
|
|
154
|
+
to_version: "8.0"
|
|
155
|
+
description: "Hook argument 'path' renamed to 'module_path' (pathlib.Path)"
|
|
156
|
+
replacement: "pytest_pycollect_makemodule(module_path=...)"
|
|
157
|
+
has_deterministic_transform: true
|
|
158
|
+
transform_name: hook_path_to_module_path
|
|
159
|
+
|
|
160
|
+
# setup/teardown method renames (nose compatibility removal)
|
|
161
|
+
- symbol: "setup()"
|
|
162
|
+
change_type: renamed
|
|
163
|
+
severity: medium
|
|
164
|
+
from_version: "7.0"
|
|
165
|
+
to_version: "8.0"
|
|
166
|
+
description: "Nose-style setup() method deprecated, use setup_method() instead"
|
|
167
|
+
replacement: "setup_method()"
|
|
168
|
+
has_deterministic_transform: true
|
|
169
|
+
transform_name: setup_to_setup_method
|
|
170
|
+
notes: "Only applies to methods in test classes, not module-level functions"
|
|
171
|
+
|
|
172
|
+
- symbol: "teardown()"
|
|
173
|
+
change_type: renamed
|
|
174
|
+
severity: medium
|
|
175
|
+
from_version: "7.0"
|
|
176
|
+
to_version: "8.0"
|
|
177
|
+
description: "Nose-style teardown() method deprecated, use teardown_method() instead"
|
|
178
|
+
replacement: "teardown_method()"
|
|
179
|
+
has_deterministic_transform: true
|
|
180
|
+
transform_name: teardown_to_teardown_method
|
|
181
|
+
notes: "Only applies to methods in test classes, not module-level functions"
|
|
182
|
+
|
|
183
|
+
# pytest.importorskip exc_type
|
|
184
|
+
- symbol: "pytest.importorskip()"
|
|
185
|
+
change_type: behavior_change
|
|
186
|
+
severity: low
|
|
187
|
+
from_version: "8.0"
|
|
188
|
+
to_version: "8.2"
|
|
189
|
+
description: "pytest.importorskip now warns when catching ImportError without exc_type parameter"
|
|
190
|
+
replacement: "pytest.importorskip(..., exc_type=ImportError)"
|
|
191
|
+
has_deterministic_transform: false
|
|
192
|
+
notes: "Only needed if intentionally catching ImportError, not ModuleNotFoundError"
|
|
@@ -121,8 +121,9 @@ breaking_changes:
|
|
|
121
121
|
to_version: "2.0"
|
|
122
122
|
description: "engine.execute() removed, use with engine.connect()"
|
|
123
123
|
replacement: "with engine.connect() as conn: conn.execute()"
|
|
124
|
-
has_deterministic_transform:
|
|
124
|
+
has_deterministic_transform: false
|
|
125
125
|
transform_name: engine_execute_to_connect
|
|
126
|
+
notes: "Requires manual migration - transformation involves restructuring code to use a context manager"
|
|
126
127
|
|
|
127
128
|
- symbol: "connection.execute(string)"
|
|
128
129
|
change_type: removed
|
codeshift/migrator/engine.py
CHANGED
|
@@ -345,6 +345,66 @@ class MigrationEngine:
|
|
|
345
345
|
)
|
|
346
346
|
|
|
347
347
|
return transform_requests
|
|
348
|
+
elif library == "numpy":
|
|
349
|
+
from codeshift.migrator.transforms.numpy_transformer import (
|
|
350
|
+
transform_numpy,
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
return transform_numpy
|
|
354
|
+
elif library == "marshmallow":
|
|
355
|
+
from codeshift.migrator.transforms.marshmallow_transformer import (
|
|
356
|
+
transform_marshmallow,
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
return transform_marshmallow
|
|
360
|
+
elif library == "pytest":
|
|
361
|
+
from codeshift.migrator.transforms.pytest_transformer import (
|
|
362
|
+
transform_pytest,
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
return transform_pytest
|
|
366
|
+
elif library == "attrs":
|
|
367
|
+
from codeshift.migrator.transforms.attrs_transformer import (
|
|
368
|
+
transform_attrs,
|
|
369
|
+
)
|
|
370
|
+
|
|
371
|
+
return transform_attrs
|
|
372
|
+
elif library == "django":
|
|
373
|
+
from codeshift.migrator.transforms.django_transformer import (
|
|
374
|
+
transform_django,
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
return transform_django
|
|
378
|
+
elif library == "flask":
|
|
379
|
+
from codeshift.migrator.transforms.flask_transformer import (
|
|
380
|
+
transform_flask,
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
return transform_flask
|
|
384
|
+
elif library == "celery":
|
|
385
|
+
from codeshift.migrator.transforms.celery_transformer import (
|
|
386
|
+
transform_celery,
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
return transform_celery
|
|
390
|
+
elif library == "click":
|
|
391
|
+
from codeshift.migrator.transforms.click_transformer import (
|
|
392
|
+
transform_click,
|
|
393
|
+
)
|
|
394
|
+
|
|
395
|
+
return transform_click
|
|
396
|
+
elif library == "httpx":
|
|
397
|
+
from codeshift.migrator.transforms.httpx_transformer import (
|
|
398
|
+
transform_httpx,
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
return transform_httpx
|
|
402
|
+
elif library == "aiohttp":
|
|
403
|
+
from codeshift.migrator.transforms.aiohttp_transformer import (
|
|
404
|
+
transform_aiohttp,
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
return transform_aiohttp
|
|
348
408
|
except ImportError:
|
|
349
409
|
pass
|
|
350
410
|
|