codeshift 0.3.2__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/commands/upgrade_all.py +4 -1
- 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/scanner/dependency_parser.py +1 -1
- {codeshift-0.3.2.dist-info → codeshift-0.3.4.dist-info}/METADATA +46 -4
- {codeshift-0.3.2.dist-info → codeshift-0.3.4.dist-info}/RECORD +38 -17
- {codeshift-0.3.2.dist-info → codeshift-0.3.4.dist-info}/WHEEL +0 -0
- {codeshift-0.3.2.dist-info → codeshift-0.3.4.dist-info}/entry_points.txt +0 -0
- {codeshift-0.3.2.dist-info → codeshift-0.3.4.dist-info}/licenses/LICENSE +0 -0
- {codeshift-0.3.2.dist-info → codeshift-0.3.4.dist-info}/top_level.txt +0 -0
|
@@ -370,7 +370,7 @@ class DependencyParser:
|
|
|
370
370
|
|
|
371
371
|
# Pattern for standard dependencies: "pydantic>=1.0,<2.0" or "pydantic==1.10.0"
|
|
372
372
|
# Match the package name followed by version specifiers
|
|
373
|
-
pattern = rf'(
|
|
373
|
+
pattern = rf'"({name})((?:[><=!~]+[^"]*)?)"'
|
|
374
374
|
replacement = rf'"\1>={new_version}"'
|
|
375
375
|
content = re.sub(pattern, replacement, content, flags=re.IGNORECASE)
|
|
376
376
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeshift
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: AI-powered CLI tool that migrates Python code to handle breaking dependency changes
|
|
5
5
|
Author: PyResolve Team
|
|
6
6
|
License: MIT
|
|
@@ -84,6 +84,16 @@ PyResolve is an AI-powered CLI tool that migrates Python code to handle breaking
|
|
|
84
84
|
| SQLAlchemy | 1.4 → 2.0 | ✅ Supported |
|
|
85
85
|
| Pandas | 1.x → 2.x | ✅ Supported |
|
|
86
86
|
| Requests | Various | ✅ Supported |
|
|
87
|
+
| Django | 3.x → 4.x/5.x | ✅ Supported |
|
|
88
|
+
| Flask | 1.x → 2.x/3.x | ✅ Supported |
|
|
89
|
+
| NumPy | 1.x → 2.x | ✅ Supported |
|
|
90
|
+
| attrs | attr → attrs | ✅ Supported |
|
|
91
|
+
| Celery | 4.x → 5.x | ✅ Supported |
|
|
92
|
+
| Click | 7.x → 8.x | ✅ Supported |
|
|
93
|
+
| aiohttp | 2.x → 3.x | ✅ Supported |
|
|
94
|
+
| httpx | 0.x → 0.24+ | ✅ Supported |
|
|
95
|
+
| Marshmallow | 2.x → 3.x | ✅ Supported |
|
|
96
|
+
| pytest | 6.x → 7.x/8.x | ✅ Supported |
|
|
87
97
|
|
|
88
98
|
### Any Library (Auto-Generated Knowledge Base)
|
|
89
99
|
|
|
@@ -104,7 +114,10 @@ pyresolve scan
|
|
|
104
114
|
# Scan with detailed breaking change analysis
|
|
105
115
|
pyresolve scan --fetch-changes
|
|
106
116
|
|
|
107
|
-
#
|
|
117
|
+
# Upgrade all outdated packages at once
|
|
118
|
+
pyresolve upgrade-all
|
|
119
|
+
|
|
120
|
+
# Or analyze and propose changes for a specific library
|
|
108
121
|
pyresolve upgrade pydantic --target 2.5.0
|
|
109
122
|
|
|
110
123
|
# View detailed diff of proposed changes
|
|
@@ -231,6 +244,35 @@ pyresolve apply
|
|
|
231
244
|
# --file, -f Apply changes to specific file only
|
|
232
245
|
```
|
|
233
246
|
|
|
247
|
+
### Upgrade-All Command
|
|
248
|
+
|
|
249
|
+
Upgrade all outdated packages to their latest versions in one go:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
pyresolve upgrade-all
|
|
253
|
+
|
|
254
|
+
# Options:
|
|
255
|
+
# --all, -a Include all outdated packages (not just Tier 1)
|
|
256
|
+
# --path, -p Path to analyze (default: current directory)
|
|
257
|
+
# --dry-run Show what would be changed without saving state
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Libraries Command
|
|
261
|
+
|
|
262
|
+
List all supported libraries and their migration paths:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
pyresolve libraries
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Status Command
|
|
269
|
+
|
|
270
|
+
Show current migration status, pending changes, and quota information:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
pyresolve status
|
|
274
|
+
```
|
|
275
|
+
|
|
234
276
|
## How It Works
|
|
235
277
|
|
|
236
278
|
```text
|
|
@@ -261,7 +303,7 @@ pyresolve apply
|
|
|
261
303
|
2. **Parse Changes**: Uses LLM to extract breaking changes with confidence levels (HIGH/MEDIUM/LOW)
|
|
262
304
|
3. **Scan Codebase**: Finds imports and usage of the target library
|
|
263
305
|
4. **Tiered Migration**:
|
|
264
|
-
- **Tier 1**: Deterministic AST transforms for
|
|
306
|
+
- **Tier 1**: Deterministic AST transforms for 15 supported libraries (Pydantic, FastAPI, SQLAlchemy, Django, Flask, NumPy, Pandas, Requests, attrs, Celery, Click, aiohttp, httpx, Marshmallow, pytest)
|
|
265
307
|
- **Tier 2**: Knowledge base guided migration with LLM assistance
|
|
266
308
|
- **Tier 3**: Pure LLM migration for unknown patterns
|
|
267
309
|
5. **Validate**: Runs syntax checks and optionally your test suite
|
|
@@ -303,7 +345,7 @@ PyResolve uses a tiered pricing model:
|
|
|
303
345
|
|
|
304
346
|
| Tier | Price | Features |
|
|
305
347
|
|------|-------|----------|
|
|
306
|
-
| **Free** | $0/month | Tier 1 deterministic transforms (Pydantic,
|
|
348
|
+
| **Free** | $0/month | Tier 1 deterministic transforms (15 libraries including Pydantic, Django, Flask, SQLAlchemy, and more) |
|
|
307
349
|
| **Pro** | $19/month | Tier 2 KB-guided LLM migrations for any library |
|
|
308
350
|
| **Unlimited** | $49/month | Tier 3 pure LLM migrations + priority support |
|
|
309
351
|
|
|
@@ -19,41 +19,62 @@ codeshift/api/routers/usage.py,sha256=sLaefM9T-3Kw-OGKOIERS_Z3btZTDx8Mxu-6zAuvF-
|
|
|
19
19
|
codeshift/api/routers/webhooks.py,sha256=oHn-Fie4KxbPnfP7hdSe8yfp8JHNDkdyBBj2kGnbnfA,8733
|
|
20
20
|
codeshift/cli/__init__.py,sha256=khf471pmz_J7-MGnarVWvmM0mCKFvdXpaPSJgx-KvD4,87
|
|
21
21
|
codeshift/cli/main.py,sha256=iHNfLciYfq2F_QF-7hBFQvT7ezbIFg0zPJesWoKPT3Y,6983
|
|
22
|
+
codeshift/cli/package_manager.py,sha256=K7spYHSQ6VoHlrzM3L9B2JoxBTe_9gLd57P6ME0PsSI,2807
|
|
22
23
|
codeshift/cli/quota.py,sha256=zBiY3zqCGEyxbS3vnoQdgBld1emMQzLc0_5cUOWy9U8,5989
|
|
23
24
|
codeshift/cli/commands/__init__.py,sha256=phw462By4_CzFoJQUdON73qF5-5Mv45GwUEOX_5SbLc,218
|
|
24
|
-
codeshift/cli/commands/apply.py,sha256=
|
|
25
|
+
codeshift/cli/commands/apply.py,sha256=JqUiu6I5WD25677SXpOejKxLWNIUQUKrbOQ_JbpoEak,11213
|
|
25
26
|
codeshift/cli/commands/auth.py,sha256=uXUtNEtAH17vhSlANfcFR5pCP8NQmFJ7Uw0bN30rYlM,28066
|
|
26
27
|
codeshift/cli/commands/diff.py,sha256=4LjrVRu4lhj-aOBvClOnEnN0l2nZEU5S1_qzYoXL4dQ,6357
|
|
27
28
|
codeshift/cli/commands/scan.py,sha256=JXR3MMKWOh1dlAEJ-OXh-EjCDBrBMxqzI6snZcBirqU,11386
|
|
28
29
|
codeshift/cli/commands/upgrade.py,sha256=_V1BP15BJR6OZHg7jdq90kfdUpjquf_FoWNNEWNzrnI,15874
|
|
29
|
-
codeshift/cli/commands/upgrade_all.py,sha256=
|
|
30
|
+
codeshift/cli/commands/upgrade_all.py,sha256=v-fz9jWCzJWWW6d0QXTdOfd2M54okI9AA6qv7qxLPiE,18964
|
|
30
31
|
codeshift/knowledge/__init__.py,sha256=_YwrLgjvsJQuYajfnIhUQqFeircF0MfkI9zJBPZTupc,1221
|
|
31
32
|
codeshift/knowledge/cache.py,sha256=aEx9aNDfrzCYMzlPRBzBOYiFIAGDcZJfQvcXroa5vsA,4837
|
|
32
|
-
codeshift/knowledge/generator.py,sha256=
|
|
33
|
+
codeshift/knowledge/generator.py,sha256=WVCF0ULYmVQRHBiK6BTyS6FuArSCj-UDWzPJLujVbxU,7304
|
|
33
34
|
codeshift/knowledge/models.py,sha256=tvM6dnZJ00nJttIDMYxKlc8fYadgCdP2bqMVTA7o3HY,5157
|
|
34
35
|
codeshift/knowledge/parser.py,sha256=uWm8IjOYoV06Sx5_odyrLB93XL1GNRHdzuNVSFM-fMA,8493
|
|
35
36
|
codeshift/knowledge/sources.py,sha256=4GA4z4gHADCAfeBTF3dAO2S6H4s9leUKoxKPK2Vcopk,12280
|
|
36
37
|
codeshift/knowledge_base/__init__.py,sha256=-xiDpdKrizX-5FeA8NjnHxASkkv44BwiMORTYF29Vj4,368
|
|
37
38
|
codeshift/knowledge_base/loader.py,sha256=xMOSJEtnlzA1sGHGqeWdwzv2rF-LvVfSgEx9Q5WMTGk,3484
|
|
38
39
|
codeshift/knowledge_base/models.py,sha256=OwA9ts14aMW-PfWBi8GFcwHIGls5ERur7FCQXYcIU7k,3816
|
|
40
|
+
codeshift/knowledge_base/libraries/aiohttp.yaml,sha256=0JjP5BQdW172MmUE0U-xeCeavO0PN8_a1hM6W7zqQLI,6469
|
|
41
|
+
codeshift/knowledge_base/libraries/attrs.yaml,sha256=iih_l9GaETP-FTy0ktqgOHlcUIiXaIT7TInfquV8XHo,5776
|
|
42
|
+
codeshift/knowledge_base/libraries/celery.yaml,sha256=jE0gvUv5VpzgIp8Pmgh_pL64SJoXpMZojTuxtczMgQg,8455
|
|
43
|
+
codeshift/knowledge_base/libraries/click.yaml,sha256=JoGFDVzV_49ZWp0It0VTPjrfQOXBoDJXlEzuJxwUSFQ,6689
|
|
44
|
+
codeshift/knowledge_base/libraries/django.yaml,sha256=F5FGfiZBOBAiHcTrUhNfjt4DUoa8MaNZCPCyFgSeFu8,12224
|
|
39
45
|
codeshift/knowledge_base/libraries/fastapi.yaml,sha256=i6dXGbEP1bn2k06XgqzgvqE2Wle_NZRhUBTk06KhW3Y,6419
|
|
46
|
+
codeshift/knowledge_base/libraries/flask.yaml,sha256=HETNUj5nrsCMH8sFwN1zPmUXGfcGWo5KhCDY4-hilR0,9401
|
|
47
|
+
codeshift/knowledge_base/libraries/httpx.yaml,sha256=Pgr13Vs3O8jKNu0Ttga9cfaQpYwPkjNHzvCbAvu-itg,6516
|
|
48
|
+
codeshift/knowledge_base/libraries/marshmallow.yaml,sha256=1K3VrNGsjka7bfHMOwUrlvBv-j2tgLOg7MDGflWDDZM,8307
|
|
49
|
+
codeshift/knowledge_base/libraries/numpy.yaml,sha256=kpV1BNXTmLE9Lbki6caLHKpRzLYpPDkc-e3NtELtH1Y,13020
|
|
40
50
|
codeshift/knowledge_base/libraries/pandas.yaml,sha256=cgu-dAaXIVyZivRr7swh3Df-GEpVfcxh5-J-6ow_pLc,10366
|
|
41
51
|
codeshift/knowledge_base/libraries/pydantic.yaml,sha256=nTleM2JaabzrcJoMPrIYhPbV93Gl3GZ1uQnQSeHBw_w,8150
|
|
52
|
+
codeshift/knowledge_base/libraries/pytest.yaml,sha256=I9_hz3_nqFxZVFoRJL2x7AP30bQxXHM1T6aU0PyEvQs,6601
|
|
42
53
|
codeshift/knowledge_base/libraries/requests.yaml,sha256=8Msjlt8v4mCEmTIdyvlpgtWsCXarpPqXNMPFlFd_Ojc,9035
|
|
43
|
-
codeshift/knowledge_base/libraries/sqlalchemy.yaml,sha256=
|
|
54
|
+
codeshift/knowledge_base/libraries/sqlalchemy.yaml,sha256=qEk1Nc2ovgCiBLPLsBrcsWM_KZaJn8MlHotDyZkzX9w,9717
|
|
44
55
|
codeshift/migrator/__init__.py,sha256=V5ATKxw4hV6Ec3g78IeHkP92-VM4l6OzH0gi-lnU09w,467
|
|
45
56
|
codeshift/migrator/ast_transforms.py,sha256=fyySqSIFVHS8jTFledkbGWQ-_zcC5-S_rsv4sPu9jEA,7190
|
|
46
|
-
codeshift/migrator/engine.py,sha256=
|
|
57
|
+
codeshift/migrator/engine.py,sha256=QkxkAFIewmSOwFW041BtPBqEfv7x8nVH8zsS-bSB1Do,14572
|
|
47
58
|
codeshift/migrator/llm_migrator.py,sha256=dyxVNu8Rf0FPM7Q_4TXt8f5nbbMqOHOIc_zbMsRm3RU,10373
|
|
48
|
-
codeshift/migrator/transforms/__init__.py,sha256=
|
|
49
|
-
codeshift/migrator/transforms/
|
|
59
|
+
codeshift/migrator/transforms/__init__.py,sha256=WWeJSr4dOKXwl8XmoCBhkYTxd4e0ENEwfMoLNwkGYsc,807
|
|
60
|
+
codeshift/migrator/transforms/aiohttp_transformer.py,sha256=-7N9xYeoDSOy4iUujKU_0CtTfQS2Mx4P9lKEvriN6YQ,23297
|
|
61
|
+
codeshift/migrator/transforms/attrs_transformer.py,sha256=_Bgg-oLUzvTENZnH1yIORH2rV9F2vJinnyRwQpBalXM,24128
|
|
62
|
+
codeshift/migrator/transforms/celery_transformer.py,sha256=dLGe_DmvmPtiDTtupoMOYNYhjy6FjYlIagzcgQtos90,23520
|
|
63
|
+
codeshift/migrator/transforms/click_transformer.py,sha256=iDboY_I6K6SnvMthl4CRXGupOEHf8Oln33vE5EeFTF8,22258
|
|
64
|
+
codeshift/migrator/transforms/django_transformer.py,sha256=21gHStxJNHRj8x_pVfRB8pcUTUkqOAKc1WE0Qd48WwM,34719
|
|
65
|
+
codeshift/migrator/transforms/fastapi_transformer.py,sha256=axFZhCdMo3gAtHPxboSDhx56RasMjREcfaI5aweivfA,7495
|
|
66
|
+
codeshift/migrator/transforms/flask_transformer.py,sha256=VcBlXDlhwgsk_1S2fyi3QsRSOUeE_DohMPjXbp4DY_A,20031
|
|
67
|
+
codeshift/migrator/transforms/httpx_transformer.py,sha256=fxqmnJhWdUHuY0a9uXQZ2MFdF9kdxjm6c3UDgeMiFP0,16952
|
|
68
|
+
codeshift/migrator/transforms/marshmallow_transformer.py,sha256=tLXX7Vko8OJQ9E1oSDooqGU-bjIgaC7-ZsK_aixPhrk,18339
|
|
69
|
+
codeshift/migrator/transforms/numpy_transformer.py,sha256=y4lJcAiT3UK8ZtZptCoSkli0UGNzhAyfUIf_I1F7WSE,15165
|
|
50
70
|
codeshift/migrator/transforms/pandas_transformer.py,sha256=93WoeY9FOLChAWKr9xTbkQCpOS1kwajzNfWqfrNE-bY,8905
|
|
51
|
-
codeshift/migrator/transforms/pydantic_v1_to_v2.py,sha256=
|
|
52
|
-
codeshift/migrator/transforms/
|
|
53
|
-
codeshift/migrator/transforms/
|
|
71
|
+
codeshift/migrator/transforms/pydantic_v1_to_v2.py,sha256=J89WJF_gOeg0FUB0G2X5OCUt31zbCrGmhsBojqDgqX0,26879
|
|
72
|
+
codeshift/migrator/transforms/pytest_transformer.py,sha256=zcNoY0HWONvT2jpAoP01Nk-N-drwVLttTHbOZgb6HlM,13724
|
|
73
|
+
codeshift/migrator/transforms/requests_transformer.py,sha256=r2hqawzdvsjblUHPoYU1tQ-miVqi1EEVsBPLXpzZz_s,12537
|
|
74
|
+
codeshift/migrator/transforms/sqlalchemy_transformer.py,sha256=rgoIk4_iDCuydZhy9svdiNlZPnmI0sQuJB5F3f7LH3Y,34286
|
|
54
75
|
codeshift/scanner/__init__.py,sha256=GFx9yMPZVuxBC8mGOPZoINsCsJgHV4TSjiV4KSF3fPU,300
|
|
55
76
|
codeshift/scanner/code_scanner.py,sha256=YGuHVI1FN0h8cGSARFlF5duFd8WBCJUSVMcqCbsjqEQ,12859
|
|
56
|
-
codeshift/scanner/dependency_parser.py,sha256=
|
|
77
|
+
codeshift/scanner/dependency_parser.py,sha256=Vd-wbgcG2trgLN7wntbNrGwuXvamn3u7B5SGvORdPiY,15372
|
|
57
78
|
codeshift/utils/__init__.py,sha256=dNtKUzFwoMxuEl41d_V0Zggv5lprZnOowB8Qt_THwbg,148
|
|
58
79
|
codeshift/utils/api_client.py,sha256=RUbKiox9dc_xc4z7IcrZ7plObYkkaKFa7Dw4qi75KGw,8010
|
|
59
80
|
codeshift/utils/cache.py,sha256=WHwNToQVmzhLgmHvt9nWUlzDFmVLBp_Sax7R4rrQfOg,8793
|
|
@@ -62,9 +83,9 @@ codeshift/utils/llm_client.py,sha256=WkT3KftJi7rsj8MXH4MVJvznugicb2XpkKqnqRET1eo
|
|
|
62
83
|
codeshift/validator/__init__.py,sha256=WRQSfJ7eLJdjR2_f_dXSaBtfawkvu1Dlu20Gh76D12c,280
|
|
63
84
|
codeshift/validator/syntax_checker.py,sha256=FJeLIqhNhV7_Xj2RskHScJZks6A9fybaqv5Z1-MGDfo,5343
|
|
64
85
|
codeshift/validator/test_runner.py,sha256=VX0OqkuI3AJxOUzRW2_BEjdDsMw1N4a0od-pPbSF6O8,6760
|
|
65
|
-
codeshift-0.3.
|
|
66
|
-
codeshift-0.3.
|
|
67
|
-
codeshift-0.3.
|
|
68
|
-
codeshift-0.3.
|
|
69
|
-
codeshift-0.3.
|
|
70
|
-
codeshift-0.3.
|
|
86
|
+
codeshift-0.3.4.dist-info/licenses/LICENSE,sha256=SrjIFBfm7GQh90Giv7mEiPnYdgp1wsp0RnOTT6HkeVw,1066
|
|
87
|
+
codeshift-0.3.4.dist-info/METADATA,sha256=n6H_6uSYelvo-BtuUa3_iIr1H0fsq96HyDqWtiI-19s,14492
|
|
88
|
+
codeshift-0.3.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
89
|
+
codeshift-0.3.4.dist-info/entry_points.txt,sha256=AlJ8V7a2pNyu-9UiRKUWiTMIJtaYAUnlg53Y-wFHiK0,53
|
|
90
|
+
codeshift-0.3.4.dist-info/top_level.txt,sha256=Ct42mtGs5foZ4MyYSksd5rXP0qFhWSZz8Y8mON0EEds,10
|
|
91
|
+
codeshift-0.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|