codeshift 0.3.5__py3-none-any.whl → 0.3.6__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-0.3.6.dist-info/METADATA +473 -0
- {codeshift-0.3.5.dist-info → codeshift-0.3.6.dist-info}/RECORD +6 -6
- codeshift-0.3.5.dist-info/METADATA +0 -368
- {codeshift-0.3.5.dist-info → codeshift-0.3.6.dist-info}/WHEEL +0 -0
- {codeshift-0.3.5.dist-info → codeshift-0.3.6.dist-info}/entry_points.txt +0 -0
- {codeshift-0.3.5.dist-info → codeshift-0.3.6.dist-info}/licenses/LICENSE +0 -0
- {codeshift-0.3.5.dist-info → codeshift-0.3.6.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codeshift
|
|
3
|
+
Version: 0.3.6
|
|
4
|
+
Summary: AI-powered CLI tool that migrates Python code to handle breaking dependency changes
|
|
5
|
+
Author: PyResolve Team
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Ragab-Technologies/Codeshift
|
|
8
|
+
Project-URL: Repository, https://github.com/Ragab-Technologies/Codeshift
|
|
9
|
+
Project-URL: Issues, https://github.com/Ragab-Technologies/Codeshift/issues
|
|
10
|
+
Keywords: migration,dependencies,ast,refactoring,pydantic
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: click>=8.0
|
|
23
|
+
Requires-Dist: libcst>=1.0
|
|
24
|
+
Requires-Dist: anthropic>=0.20
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: rich>=13.0
|
|
27
|
+
Requires-Dist: toml>=0.10
|
|
28
|
+
Requires-Dist: packaging>=23.0
|
|
29
|
+
Requires-Dist: httpx>=0.25
|
|
30
|
+
Requires-Dist: pytest>=8.4.2
|
|
31
|
+
Requires-Dist: nox>=2025.11.12
|
|
32
|
+
Requires-Dist: black>=24.10.0
|
|
33
|
+
Requires-Dist: mypy>=1.19.1
|
|
34
|
+
Requires-Dist: supabase>=2.27.2
|
|
35
|
+
Requires-Dist: pre-commit>=4.5.1
|
|
36
|
+
Provides-Extra: api
|
|
37
|
+
Requires-Dist: fastapi>=0.109.0; extra == "api"
|
|
38
|
+
Requires-Dist: uvicorn>=0.27.0; extra == "api"
|
|
39
|
+
Requires-Dist: supabase>=2.3.0; extra == "api"
|
|
40
|
+
Requires-Dist: stripe>=7.0.0; extra == "api"
|
|
41
|
+
Requires-Dist: pydantic-settings>=2.1.0; extra == "api"
|
|
42
|
+
Requires-Dist: email-validator>=2.0.0; extra == "api"
|
|
43
|
+
Provides-Extra: dev
|
|
44
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
45
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
46
|
+
Requires-Dist: black<25.0,>=24.0; extra == "dev"
|
|
47
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
48
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
49
|
+
Requires-Dist: nox>=2024.0; extra == "dev"
|
|
50
|
+
Requires-Dist: pre-commit>=3.6.0; extra == "dev"
|
|
51
|
+
Requires-Dist: types-toml>=0.10; extra == "dev"
|
|
52
|
+
Requires-Dist: types-PyYAML>=6.0; extra == "dev"
|
|
53
|
+
Provides-Extra: all
|
|
54
|
+
Requires-Dist: codeshift[api,dev]; extra == "all"
|
|
55
|
+
Dynamic: license-file
|
|
56
|
+
|
|
57
|
+
# Codeshift
|
|
58
|
+
|
|
59
|
+
[](https://github.com/Ragab-Technologies/Codeshift/actions/workflows/ci.yml)
|
|
60
|
+
[](https://pypi.org/project/codeshift/)
|
|
61
|
+
[](https://www.python.org/downloads/)
|
|
62
|
+
[](LICENSE)
|
|
63
|
+
|
|
64
|
+
**Don't just flag the update. Fix the break.**
|
|
65
|
+
|
|
66
|
+
Codeshift is an AI-powered CLI tool that migrates Python code when dependencies are upgraded. Unlike Dependabot or Renovate which only bump version numbers, Codeshift rewrites your code to be compatible with new library APIs.
|
|
67
|
+
|
|
68
|
+
## Why Codeshift?
|
|
69
|
+
|
|
70
|
+
Upgrading a dependency often means updating dozens of call sites to match a new API. Codeshift automates that:
|
|
71
|
+
|
|
72
|
+
- **Scans** your project for outdated dependencies
|
|
73
|
+
- **Detects** breaking changes from changelogs and migration guides
|
|
74
|
+
- **Rewrites** your code using deterministic AST transforms or LLM assistance
|
|
75
|
+
- **Shows** a detailed diff with explanations before touching any file
|
|
76
|
+
|
|
77
|
+
## Features
|
|
78
|
+
|
|
79
|
+
- **Deterministic AST transforms** for 15 popular libraries (no LLM required)
|
|
80
|
+
- **Auto-generated knowledge bases** - fetches changelogs and migration guides from GitHub, parses them with an LLM to detect breaking changes
|
|
81
|
+
- **Tiered migration engine** - deterministic transforms first, KB-guided LLM second, pure LLM fallback last
|
|
82
|
+
- **Confidence-based change detection** - shows HIGH/MEDIUM/LOW confidence breaking changes before migration
|
|
83
|
+
- **Beautiful diff output** with per-change explanations
|
|
84
|
+
- **Backup and restore** so you can safely revert
|
|
85
|
+
- **Batch upgrades** - migrate all outdated dependencies in one command
|
|
86
|
+
|
|
87
|
+
## Supported Libraries
|
|
88
|
+
|
|
89
|
+
### Tier 1 (Deterministic AST Transforms - Free, No LLM Required)
|
|
90
|
+
|
|
91
|
+
| Library | Migration Path | Status |
|
|
92
|
+
|---------|---------------|--------|
|
|
93
|
+
| Pydantic | v1 → v2 | Supported |
|
|
94
|
+
| FastAPI | 0.x → 0.100+ | Supported |
|
|
95
|
+
| SQLAlchemy | 1.4 → 2.0 | Supported |
|
|
96
|
+
| Pandas | 1.x → 2.x | Supported |
|
|
97
|
+
| Requests | Various | Supported |
|
|
98
|
+
| Django | 3.x → 4.x/5.x | Supported |
|
|
99
|
+
| Flask | 1.x → 2.x/3.x | Supported |
|
|
100
|
+
| NumPy | 1.x → 2.x | Supported |
|
|
101
|
+
| attrs | attr → attrs | Supported |
|
|
102
|
+
| Celery | 4.x → 5.x | Supported |
|
|
103
|
+
| Click | 7.x → 8.x | Supported |
|
|
104
|
+
| aiohttp | 2.x → 3.x | Supported |
|
|
105
|
+
| httpx | 0.x → 0.24+ | Supported |
|
|
106
|
+
| Marshmallow | 2.x → 3.x | Supported |
|
|
107
|
+
| pytest | 6.x → 7.x/8.x | Supported |
|
|
108
|
+
|
|
109
|
+
### Any Library (Auto-Generated Knowledge Base)
|
|
110
|
+
|
|
111
|
+
Codeshift can migrate **any Python library** by automatically fetching changelogs from GitHub and detecting breaking changes. For libraries not in Tier 1, it uses KB-guided or pure LLM migration.
|
|
112
|
+
|
|
113
|
+
## Installation
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pip install codeshift
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
For development:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pip install codeshift[dev]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Verify the installation:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
codeshift --help
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Quick Start
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# 1. Scan your project for outdated dependencies
|
|
135
|
+
codeshift scan
|
|
136
|
+
|
|
137
|
+
# 2. Upgrade a specific library
|
|
138
|
+
codeshift upgrade pydantic --target 2.5.0
|
|
139
|
+
|
|
140
|
+
# 3. Review the proposed changes
|
|
141
|
+
codeshift diff
|
|
142
|
+
|
|
143
|
+
# 4. Apply the changes
|
|
144
|
+
codeshift apply
|
|
145
|
+
|
|
146
|
+
# 5. Run your tests to verify
|
|
147
|
+
pytest
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Or upgrade everything at once:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
codeshift upgrade-all
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Example Output
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
$ codeshift upgrade pydantic --target 2.5.0
|
|
160
|
+
|
|
161
|
+
╭──────────────────────── Codeshift Migration ─────────────────────────╮
|
|
162
|
+
│ Upgrading Pydantic to version 2.5.0 │
|
|
163
|
+
│ Migration guide: https://docs.pydantic.dev/latest/migration/ │
|
|
164
|
+
╰──────────────────────────────────────────────────────────────────────╯
|
|
165
|
+
|
|
166
|
+
Fetching knowledge sources...
|
|
167
|
+
✓ GitHub: CHANGELOG.md
|
|
168
|
+
✓ GitHub: docs/migration.md
|
|
169
|
+
|
|
170
|
+
Breaking changes detected:
|
|
171
|
+
|
|
172
|
+
HIGH CONFIDENCE:
|
|
173
|
+
├── .dict() → .model_dump()
|
|
174
|
+
├── @validator → @field_validator
|
|
175
|
+
└── class Config → model_config = ConfigDict()
|
|
176
|
+
|
|
177
|
+
MEDIUM CONFIDENCE:
|
|
178
|
+
├── .json() → .model_dump_json()
|
|
179
|
+
└── parse_obj() → model_validate()
|
|
180
|
+
|
|
181
|
+
Scanning for library usage...
|
|
182
|
+
Found 12 imports from pydantic
|
|
183
|
+
Found 45 usages of pydantic symbols
|
|
184
|
+
|
|
185
|
+
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
|
|
186
|
+
┃ File ┃ Changes ┃ Status ┃
|
|
187
|
+
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
|
|
188
|
+
│ src/models/user.py │ 5 │ Ready │
|
|
189
|
+
│ src/api/schemas.py │ 3 │ Ready │
|
|
190
|
+
└────────────────────┴─────────┴────────┘
|
|
191
|
+
|
|
192
|
+
Total: 8 changes across 2 files
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Commands
|
|
196
|
+
|
|
197
|
+
### `codeshift scan`
|
|
198
|
+
|
|
199
|
+
Scan your project for outdated dependencies and available migrations.
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
codeshift scan [OPTIONS]
|
|
203
|
+
|
|
204
|
+
Options:
|
|
205
|
+
--path, -p PATH Path to scan (default: current directory)
|
|
206
|
+
--fetch-changes Fetch changelogs and detect breaking changes
|
|
207
|
+
--major-only Only show major version upgrades
|
|
208
|
+
--json-output Output results as JSON
|
|
209
|
+
--verbose, -v Show detailed output
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Example:
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
$ codeshift scan
|
|
216
|
+
|
|
217
|
+
Found 13 dependencies
|
|
218
|
+
|
|
219
|
+
Outdated Dependencies (5)
|
|
220
|
+
┏━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━┓
|
|
221
|
+
┃ Package ┃ Current ┃ Latest ┃ Type ┃ Tier ┃
|
|
222
|
+
┡━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━┩
|
|
223
|
+
│ pydantic │ 1.0 │ 2.5.0 │ Major │ Tier 1 │
|
|
224
|
+
│ rich │ 13.0 │ 14.0.0 │ Major │ Tier 2/3 │
|
|
225
|
+
└────────────┴─────────┴────────┴───────┴──────────┘
|
|
226
|
+
|
|
227
|
+
Suggested Migrations (2)
|
|
228
|
+
pydantic 1.0 → 2.5.0 (Tier 1 - deterministic)
|
|
229
|
+
rich 13.0 → 14.0.0 (Tier 2/3 - LLM-assisted)
|
|
230
|
+
|
|
231
|
+
Quick commands:
|
|
232
|
+
codeshift upgrade pydantic --target 2.5.0
|
|
233
|
+
codeshift upgrade rich --target 14.0.0
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### `codeshift upgrade`
|
|
237
|
+
|
|
238
|
+
Analyze your codebase and propose changes for a specific library upgrade.
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
codeshift upgrade <library> --target <version> [OPTIONS]
|
|
242
|
+
|
|
243
|
+
Arguments:
|
|
244
|
+
LIBRARY Library name to upgrade (required)
|
|
245
|
+
|
|
246
|
+
Options:
|
|
247
|
+
--target, -t VERSION Target version to upgrade to (required)
|
|
248
|
+
--path, -p PATH Path to analyze (default: current directory)
|
|
249
|
+
--file, -f PATH Analyze a single file instead of the entire project
|
|
250
|
+
--dry-run Show what would be changed without saving state
|
|
251
|
+
--verbose, -v Show detailed output
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### `codeshift upgrade-all`
|
|
255
|
+
|
|
256
|
+
Upgrade all outdated packages to their latest versions in one go.
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
codeshift upgrade-all [OPTIONS]
|
|
260
|
+
|
|
261
|
+
Options:
|
|
262
|
+
--path, -p PATH Path to analyze (default: current directory)
|
|
263
|
+
--all Include all outdated packages (not just Tier 1)
|
|
264
|
+
--tier1-only Only upgrade Tier 1 libraries (deterministic transforms)
|
|
265
|
+
--major-only Only perform major version upgrades
|
|
266
|
+
--include, -i LIB Only include specific libraries (repeatable)
|
|
267
|
+
--exclude, -e LIB Exclude specific libraries (repeatable)
|
|
268
|
+
--update-deps Update dependency files with new versions (default: yes)
|
|
269
|
+
--no-update-deps Skip updating dependency files
|
|
270
|
+
--dry-run Show what would be changed without saving state
|
|
271
|
+
--verbose, -v Show detailed output
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### `codeshift diff`
|
|
275
|
+
|
|
276
|
+
View the detailed diff of proposed changes.
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
codeshift diff [OPTIONS]
|
|
280
|
+
|
|
281
|
+
Options:
|
|
282
|
+
--path, -p PATH Path to the project (default: current directory)
|
|
283
|
+
--file, -f FILE Show diff for a specific file only
|
|
284
|
+
--no-color Disable colored output
|
|
285
|
+
--context, -c INT Number of context lines (default: 3)
|
|
286
|
+
--summary Show only a summary without the full diff
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### `codeshift show`
|
|
290
|
+
|
|
291
|
+
Show the full transformed or original code for a file.
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
codeshift show <file_path> [OPTIONS]
|
|
295
|
+
|
|
296
|
+
Arguments:
|
|
297
|
+
FILE_PATH File to display (required)
|
|
298
|
+
|
|
299
|
+
Options:
|
|
300
|
+
--path, -p PATH Path to the project (default: current directory)
|
|
301
|
+
--original Show the original code instead of the transformed version
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### `codeshift apply`
|
|
305
|
+
|
|
306
|
+
Apply the proposed changes to your files.
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
codeshift apply [OPTIONS]
|
|
310
|
+
|
|
311
|
+
Options:
|
|
312
|
+
--path, -p PATH Path to the project (default: current directory)
|
|
313
|
+
--file, -f FILE Apply changes to a specific file only
|
|
314
|
+
--backup Create .bak backup files before applying changes
|
|
315
|
+
--yes, -y Skip confirmation prompt
|
|
316
|
+
--validate Validate syntax after applying (default: yes)
|
|
317
|
+
--no-validate Skip syntax validation
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### `codeshift reset`
|
|
321
|
+
|
|
322
|
+
Cancel the current migration and clear all pending changes.
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
codeshift reset [OPTIONS]
|
|
326
|
+
|
|
327
|
+
Options:
|
|
328
|
+
--path, -p PATH Path to the project (default: current directory)
|
|
329
|
+
--yes, -y Skip confirmation prompt
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### `codeshift restore`
|
|
333
|
+
|
|
334
|
+
Restore files from a backup created by `apply --backup`.
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
codeshift restore <backup_dir> [OPTIONS]
|
|
338
|
+
|
|
339
|
+
Arguments:
|
|
340
|
+
BACKUP_DIR Path to backup directory (required)
|
|
341
|
+
|
|
342
|
+
Options:
|
|
343
|
+
--path, -p PATH Path to the project (default: current directory)
|
|
344
|
+
--yes, -y Skip confirmation prompt
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### `codeshift libraries`
|
|
348
|
+
|
|
349
|
+
List all supported libraries and their migration paths.
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
codeshift libraries
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### `codeshift status`
|
|
356
|
+
|
|
357
|
+
Show current migration status, pending changes, and quota info.
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
codeshift status [OPTIONS]
|
|
361
|
+
|
|
362
|
+
Options:
|
|
363
|
+
--path, -p PATH Path to the project (default: current directory)
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Account Commands
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
codeshift login # Login to enable cloud features
|
|
370
|
+
codeshift register # Create a new account
|
|
371
|
+
codeshift logout # Logout and remove credentials
|
|
372
|
+
codeshift whoami # Show current user info
|
|
373
|
+
codeshift quota # Show usage and limits
|
|
374
|
+
codeshift upgrade-plan # View or upgrade your plan
|
|
375
|
+
codeshift billing # Open billing portal
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## How It Works
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
382
|
+
│ Knowledge Acquisition Pipeline │
|
|
383
|
+
│ ┌─────────────┐ ┌──────────────────┐ ┌─────────────────────┐ │
|
|
384
|
+
│ │ Local Cache │──▶│ On-Demand Gen │──▶│ LLM Parser │ │
|
|
385
|
+
│ │ (instant) │ │ (fetches sources)│ │ (breaking changes) │ │
|
|
386
|
+
│ └─────────────┘ └──────────────────┘ └─────────────────────┘ │
|
|
387
|
+
│ │ │
|
|
388
|
+
│ ┌───────────────┴───────────────┐ │
|
|
389
|
+
│ │ Source Fetchers │ │
|
|
390
|
+
│ │ ├── GitHub (CHANGELOG.md) │ │
|
|
391
|
+
│ │ ├── Docs (migration guides) │ │
|
|
392
|
+
│ │ └── Release notes │ │
|
|
393
|
+
│ └───────────────────────────────┘ │
|
|
394
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
395
|
+
│
|
|
396
|
+
▼
|
|
397
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
398
|
+
│ Migration Engine (Tiered) │
|
|
399
|
+
│ Tier 1: AST Transforms │ Tier 2: KB-Guided │ Tier 3: LLM │
|
|
400
|
+
│ (deterministic) │ (context + LLM) │ (fallback) │
|
|
401
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
1. **Fetch Knowledge** - discovers and fetches changelogs, migration guides from GitHub/PyPI
|
|
405
|
+
2. **Parse Changes** - uses an LLM to extract breaking changes with confidence levels (HIGH/MEDIUM/LOW)
|
|
406
|
+
3. **Scan Codebase** - finds imports and usage of the target library using libcst
|
|
407
|
+
4. **Tiered Migration**:
|
|
408
|
+
- **Tier 1**: deterministic AST transforms for 15 supported libraries - no LLM needed
|
|
409
|
+
- **Tier 2**: knowledge base guided migration with LLM assistance
|
|
410
|
+
- **Tier 3**: pure LLM migration for unknown patterns
|
|
411
|
+
5. **Validate** - runs syntax checks on the transformed code
|
|
412
|
+
6. **Report** - shows a detailed diff with explanations for each change
|
|
413
|
+
|
|
414
|
+
## Pydantic v1 → v2 Example
|
|
415
|
+
|
|
416
|
+
Codeshift handles the following Pydantic migrations automatically:
|
|
417
|
+
|
|
418
|
+
| v1 Pattern | v2 Replacement |
|
|
419
|
+
|---|---|
|
|
420
|
+
| `Config` class | `model_config = ConfigDict(...)` |
|
|
421
|
+
| `@validator` | `@field_validator` with `@classmethod` |
|
|
422
|
+
| `@root_validator` | `@model_validator` |
|
|
423
|
+
| `.dict()` | `.model_dump()` |
|
|
424
|
+
| `.json()` | `.model_dump_json()` |
|
|
425
|
+
| `.schema()` | `.model_json_schema()` |
|
|
426
|
+
| `.parse_obj()` | `.model_validate()` |
|
|
427
|
+
| `orm_mode = True` | `from_attributes = True` |
|
|
428
|
+
| `Field(regex=...)` | `Field(pattern=...)` |
|
|
429
|
+
|
|
430
|
+
## Configuration
|
|
431
|
+
|
|
432
|
+
Codeshift can be configured via `pyproject.toml`:
|
|
433
|
+
|
|
434
|
+
```toml
|
|
435
|
+
[tool.codeshift]
|
|
436
|
+
# Path patterns to exclude from scanning
|
|
437
|
+
exclude = ["tests/*", "migrations/*"]
|
|
438
|
+
|
|
439
|
+
# Enable/disable LLM fallback
|
|
440
|
+
use_llm = true
|
|
441
|
+
|
|
442
|
+
# Anthropic API key (can also use ANTHROPIC_API_KEY env var)
|
|
443
|
+
# anthropic_api_key = "sk-..."
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
## Environment Variables
|
|
447
|
+
|
|
448
|
+
| Variable | Required | Description |
|
|
449
|
+
|---|---|---|
|
|
450
|
+
| `ANTHROPIC_API_KEY` | For Tier 2/3 | Enables LLM-powered migrations |
|
|
451
|
+
| `GITHUB_TOKEN` | No | Higher GitHub API rate limits |
|
|
452
|
+
|
|
453
|
+
## Pricing
|
|
454
|
+
|
|
455
|
+
| Tier | Price | What You Get |
|
|
456
|
+
|------|-------|--------------|
|
|
457
|
+
| **Free** | $0/month | Tier 1 deterministic transforms for all 15 supported libraries. Runs entirely locally. |
|
|
458
|
+
| **Pro** | $19/month | Tier 2 KB-guided LLM migrations for any library |
|
|
459
|
+
| **Unlimited** | $49/month | Tier 3 pure LLM migrations + priority support |
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
# Login to access Pro/Unlimited features
|
|
463
|
+
codeshift login
|
|
464
|
+
|
|
465
|
+
# Check your current plan and usage
|
|
466
|
+
codeshift quota
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
## License
|
|
470
|
+
|
|
471
|
+
This software is licensed under the [MIT License](LICENSE).
|
|
472
|
+
|
|
473
|
+
You are free to use, modify, and distribute this software. The CLI tool and all transforms are fully open source.
|
|
@@ -83,9 +83,9 @@ codeshift/utils/llm_client.py,sha256=WkT3KftJi7rsj8MXH4MVJvznugicb2XpkKqnqRET1eo
|
|
|
83
83
|
codeshift/validator/__init__.py,sha256=WRQSfJ7eLJdjR2_f_dXSaBtfawkvu1Dlu20Gh76D12c,280
|
|
84
84
|
codeshift/validator/syntax_checker.py,sha256=FJeLIqhNhV7_Xj2RskHScJZks6A9fybaqv5Z1-MGDfo,5343
|
|
85
85
|
codeshift/validator/test_runner.py,sha256=VX0OqkuI3AJxOUzRW2_BEjdDsMw1N4a0od-pPbSF6O8,6760
|
|
86
|
-
codeshift-0.3.
|
|
87
|
-
codeshift-0.3.
|
|
88
|
-
codeshift-0.3.
|
|
89
|
-
codeshift-0.3.
|
|
90
|
-
codeshift-0.3.
|
|
91
|
-
codeshift-0.3.
|
|
86
|
+
codeshift-0.3.6.dist-info/licenses/LICENSE,sha256=SrjIFBfm7GQh90Giv7mEiPnYdgp1wsp0RnOTT6HkeVw,1066
|
|
87
|
+
codeshift-0.3.6.dist-info/METADATA,sha256=BRjtZ7e2RGOGGe4zpbyv-AW6TVfY4LMqMpVpCjwyMI8,17478
|
|
88
|
+
codeshift-0.3.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
89
|
+
codeshift-0.3.6.dist-info/entry_points.txt,sha256=AlJ8V7a2pNyu-9UiRKUWiTMIJtaYAUnlg53Y-wFHiK0,53
|
|
90
|
+
codeshift-0.3.6.dist-info/top_level.txt,sha256=Ct42mtGs5foZ4MyYSksd5rXP0qFhWSZz8Y8mON0EEds,10
|
|
91
|
+
codeshift-0.3.6.dist-info/RECORD,,
|
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: codeshift
|
|
3
|
-
Version: 0.3.5
|
|
4
|
-
Summary: AI-powered CLI tool that migrates Python code to handle breaking dependency changes
|
|
5
|
-
Author: PyResolve Team
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/youssefragab/PyResolve
|
|
8
|
-
Project-URL: Repository, https://github.com/youssefragab/PyResolve
|
|
9
|
-
Project-URL: Issues, https://github.com/youssefragab/PyResolve/issues
|
|
10
|
-
Keywords: migration,dependencies,ast,refactoring,pydantic
|
|
11
|
-
Classifier: Development Status :: 3 - Alpha
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
-
Requires-Python: >=3.10
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE
|
|
22
|
-
Requires-Dist: click>=8.0
|
|
23
|
-
Requires-Dist: libcst>=1.0
|
|
24
|
-
Requires-Dist: anthropic>=0.20
|
|
25
|
-
Requires-Dist: pyyaml>=6.0
|
|
26
|
-
Requires-Dist: rich>=13.0
|
|
27
|
-
Requires-Dist: toml>=0.10
|
|
28
|
-
Requires-Dist: packaging>=23.0
|
|
29
|
-
Requires-Dist: httpx>=0.25
|
|
30
|
-
Requires-Dist: pytest>=8.4.2
|
|
31
|
-
Requires-Dist: nox>=2025.11.12
|
|
32
|
-
Requires-Dist: black>=24.10.0
|
|
33
|
-
Requires-Dist: mypy>=1.19.1
|
|
34
|
-
Requires-Dist: supabase>=2.27.2
|
|
35
|
-
Requires-Dist: pre-commit>=4.5.1
|
|
36
|
-
Provides-Extra: api
|
|
37
|
-
Requires-Dist: fastapi>=0.109.0; extra == "api"
|
|
38
|
-
Requires-Dist: uvicorn>=0.27.0; extra == "api"
|
|
39
|
-
Requires-Dist: supabase>=2.3.0; extra == "api"
|
|
40
|
-
Requires-Dist: stripe>=7.0.0; extra == "api"
|
|
41
|
-
Requires-Dist: pydantic-settings>=2.1.0; extra == "api"
|
|
42
|
-
Requires-Dist: email-validator>=2.0.0; extra == "api"
|
|
43
|
-
Provides-Extra: dev
|
|
44
|
-
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
45
|
-
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
46
|
-
Requires-Dist: black<25.0,>=24.0; extra == "dev"
|
|
47
|
-
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
48
|
-
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
49
|
-
Requires-Dist: nox>=2024.0; extra == "dev"
|
|
50
|
-
Requires-Dist: pre-commit>=3.6.0; extra == "dev"
|
|
51
|
-
Requires-Dist: types-toml>=0.10; extra == "dev"
|
|
52
|
-
Requires-Dist: types-PyYAML>=6.0; extra == "dev"
|
|
53
|
-
Provides-Extra: all
|
|
54
|
-
Requires-Dist: codeshift[api,dev]; extra == "all"
|
|
55
|
-
Dynamic: license-file
|
|
56
|
-
|
|
57
|
-
# PyResolve
|
|
58
|
-
|
|
59
|
-
[](https://github.com/youssefragab/PyResolve/actions/workflows/ci.yml)
|
|
60
|
-
[](https://pypi.org/project/pyresolve/)
|
|
61
|
-
[](https://www.python.org/downloads/)
|
|
62
|
-
[](LICENSE)
|
|
63
|
-
|
|
64
|
-
**Don't just flag the update. Fix the break.**
|
|
65
|
-
|
|
66
|
-
PyResolve is an AI-powered CLI tool that migrates Python code to handle breaking dependency changes. Unlike Dependabot/Renovate which just bump versions, PyResolve actually rewrites code to be compatible with new library versions.
|
|
67
|
-
|
|
68
|
-
## Features
|
|
69
|
-
|
|
70
|
-
- **Auto-generated knowledge bases** - Fetches changelogs and migration guides from GitHub, parses them with LLM to detect breaking changes
|
|
71
|
-
- **Tiered migration approach** - Deterministic AST transforms for known patterns, KB-guided LLM for medium confidence, pure LLM fallback for complex cases
|
|
72
|
-
- **Confidence-based change detection** - Shows HIGH/MEDIUM/LOW confidence breaking changes before migration
|
|
73
|
-
- **Local test execution** to validate changes before applying
|
|
74
|
-
- **Beautiful diff output** with explanations for each change
|
|
75
|
-
|
|
76
|
-
## Supported Libraries
|
|
77
|
-
|
|
78
|
-
### Tier 1 Libraries (Deterministic AST Transforms)
|
|
79
|
-
|
|
80
|
-
| Library | Migration Path | Status |
|
|
81
|
-
|---------|---------------|--------|
|
|
82
|
-
| Pydantic | v1 → v2 | ✅ Full support |
|
|
83
|
-
| FastAPI | 0.x → 0.100+ | ✅ Supported |
|
|
84
|
-
| SQLAlchemy | 1.4 → 2.0 | ✅ Supported |
|
|
85
|
-
| Pandas | 1.x → 2.x | ✅ Supported |
|
|
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 |
|
|
97
|
-
|
|
98
|
-
### Any Library (Auto-Generated Knowledge Base)
|
|
99
|
-
|
|
100
|
-
PyResolve can migrate **any Python library** by automatically fetching changelogs from GitHub and detecting breaking changes. For libraries not in Tier 1, it uses KB-guided or pure LLM migration.
|
|
101
|
-
|
|
102
|
-
## Installation
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
pip install pyresolve
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Quick Start
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
# Scan your project for all possible migrations
|
|
112
|
-
pyresolve scan
|
|
113
|
-
|
|
114
|
-
# Scan with detailed breaking change analysis
|
|
115
|
-
pyresolve scan --fetch-changes
|
|
116
|
-
|
|
117
|
-
# Upgrade all outdated packages at once
|
|
118
|
-
pyresolve upgrade-all
|
|
119
|
-
|
|
120
|
-
# Or analyze and propose changes for a specific library
|
|
121
|
-
pyresolve upgrade pydantic --target 2.5.0
|
|
122
|
-
|
|
123
|
-
# View detailed diff of proposed changes
|
|
124
|
-
pyresolve diff
|
|
125
|
-
|
|
126
|
-
# Apply changes to your files
|
|
127
|
-
pyresolve apply
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Example Output
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
$ pyresolve upgrade pydantic --target 2.5.0
|
|
134
|
-
|
|
135
|
-
╭──────────────────────── PyResolve Migration ─────────────────────────╮
|
|
136
|
-
│ Upgrading Pydantic to version 2.5.0 │
|
|
137
|
-
│ Migration guide: https://docs.pydantic.dev/latest/migration/ │
|
|
138
|
-
╰──────────────────────────────────────────────────────────────────────╯
|
|
139
|
-
|
|
140
|
-
Fetching knowledge sources...
|
|
141
|
-
✓ GitHub: CHANGELOG.md
|
|
142
|
-
✓ GitHub: docs/migration.md
|
|
143
|
-
|
|
144
|
-
Breaking changes detected:
|
|
145
|
-
|
|
146
|
-
HIGH CONFIDENCE:
|
|
147
|
-
├── .dict() → .model_dump()
|
|
148
|
-
├── @validator → @field_validator
|
|
149
|
-
└── class Config → model_config = ConfigDict()
|
|
150
|
-
|
|
151
|
-
MEDIUM CONFIDENCE:
|
|
152
|
-
├── .json() → .model_dump_json()
|
|
153
|
-
└── parse_obj() → model_validate()
|
|
154
|
-
|
|
155
|
-
Scanning for library usage...
|
|
156
|
-
Found 12 imports from pydantic
|
|
157
|
-
Found 45 usages of pydantic symbols
|
|
158
|
-
|
|
159
|
-
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
|
|
160
|
-
┃ File ┃ Changes ┃ Status ┃
|
|
161
|
-
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
|
|
162
|
-
│ src/models/user.py │ 5 │ Ready │
|
|
163
|
-
│ src/api/schemas.py │ 3 │ Ready │
|
|
164
|
-
└────────────────────┴─────────┴────────┘
|
|
165
|
-
|
|
166
|
-
Total: 8 changes across 2 files
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## Usage
|
|
170
|
-
|
|
171
|
-
### Scan Command
|
|
172
|
-
|
|
173
|
-
Scan your entire project for possible dependency migrations:
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
pyresolve scan
|
|
177
|
-
|
|
178
|
-
# Options:
|
|
179
|
-
# --path, -p Path to scan (default: current directory)
|
|
180
|
-
# --fetch-changes Fetch changelogs and detect breaking changes (slower)
|
|
181
|
-
# --major-only Only show major version upgrades
|
|
182
|
-
# --json-output Output results as JSON
|
|
183
|
-
# --verbose, -v Show detailed output
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Example output:
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
$ pyresolve scan
|
|
190
|
-
|
|
191
|
-
Found 13 dependencies
|
|
192
|
-
|
|
193
|
-
Outdated Dependencies (5)
|
|
194
|
-
┏━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━┓
|
|
195
|
-
┃ Package ┃ Current ┃ Latest ┃ Type ┃ Tier ┃
|
|
196
|
-
┡━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━┩
|
|
197
|
-
│ pydantic │ 1.0 │ 2.5.0 │ Major │ Tier 1 │
|
|
198
|
-
│ rich │ 13.0 │ 14.0.0 │ Major │ Tier 2/3 │
|
|
199
|
-
└────────────┴─────────┴────────┴───────┴──────────┘
|
|
200
|
-
|
|
201
|
-
Suggested Migrations (2)
|
|
202
|
-
pydantic 1.0 → 2.5.0 (Tier 1 - deterministic)
|
|
203
|
-
rich 13.0 → 14.0.0 (Tier 2/3 - LLM-assisted)
|
|
204
|
-
|
|
205
|
-
Quick commands:
|
|
206
|
-
pyresolve upgrade pydantic --target 2.5.0
|
|
207
|
-
pyresolve upgrade rich --target 14.0.0
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Upgrade Command
|
|
211
|
-
|
|
212
|
-
Analyze your codebase and propose changes for a library upgrade:
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
pyresolve upgrade <library> --target <version>
|
|
216
|
-
|
|
217
|
-
# Options:
|
|
218
|
-
# --target, -t Target version to upgrade to
|
|
219
|
-
# --path, -p Path to analyze (default: current directory)
|
|
220
|
-
# --dry-run Show what would be changed without saving state
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Diff Command
|
|
224
|
-
|
|
225
|
-
View the detailed diff of proposed changes:
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
pyresolve diff
|
|
229
|
-
|
|
230
|
-
# Options:
|
|
231
|
-
# --file, -f Show diff for specific file only
|
|
232
|
-
# --no-color Disable colored output
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### Apply Command
|
|
236
|
-
|
|
237
|
-
Apply the proposed changes to your files:
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
pyresolve apply
|
|
241
|
-
|
|
242
|
-
# Options:
|
|
243
|
-
# --backup Create backup files before applying changes
|
|
244
|
-
# --file, -f Apply changes to specific file only
|
|
245
|
-
```
|
|
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
|
-
|
|
276
|
-
## How It Works
|
|
277
|
-
|
|
278
|
-
```text
|
|
279
|
-
┌─────────────────────────────────────────────────────────────────────┐
|
|
280
|
-
│ Knowledge Acquisition Pipeline │
|
|
281
|
-
│ ┌─────────────┐ ┌──────────────────┐ ┌─────────────────────┐ │
|
|
282
|
-
│ │ Local Cache │──▶│ On-Demand Gen │──▶│ LLM Parser │ │
|
|
283
|
-
│ │ (instant) │ │ (fetches sources)│ │ (breaking changes) │ │
|
|
284
|
-
│ └─────────────┘ └──────────────────┘ └─────────────────────┘ │
|
|
285
|
-
│ │ │
|
|
286
|
-
│ ┌───────────────┴───────────────┐ │
|
|
287
|
-
│ │ Source Fetchers │ │
|
|
288
|
-
│ │ ├── GitHub (CHANGELOG.md) │ │
|
|
289
|
-
│ │ ├── Docs (migration guides) │ │
|
|
290
|
-
│ │ └── Release notes │ │
|
|
291
|
-
│ └───────────────────────────────┘ │
|
|
292
|
-
└─────────────────────────────────────────────────────────────────────┘
|
|
293
|
-
│
|
|
294
|
-
▼
|
|
295
|
-
┌─────────────────────────────────────────────────────────────────────┐
|
|
296
|
-
│ Migration Engine (Tiered) │
|
|
297
|
-
│ Tier 1: AST Transforms │ Tier 2: KB-Guided │ Tier 3: LLM │
|
|
298
|
-
│ (deterministic) │ (context + LLM) │ (fallback) │
|
|
299
|
-
└─────────────────────────────────────────────────────────────────────┘
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
1. **Fetch Knowledge**: Discovers and fetches changelogs, migration guides from GitHub/PyPI
|
|
303
|
-
2. **Parse Changes**: Uses LLM to extract breaking changes with confidence levels (HIGH/MEDIUM/LOW)
|
|
304
|
-
3. **Scan Codebase**: Finds imports and usage of the target library
|
|
305
|
-
4. **Tiered Migration**:
|
|
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)
|
|
307
|
-
- **Tier 2**: Knowledge base guided migration with LLM assistance
|
|
308
|
-
- **Tier 3**: Pure LLM migration for unknown patterns
|
|
309
|
-
5. **Validate**: Runs syntax checks and optionally your test suite
|
|
310
|
-
6. **Report**: Shows a detailed diff with explanations for each change
|
|
311
|
-
|
|
312
|
-
## Pydantic v1 → v2 Transforms
|
|
313
|
-
|
|
314
|
-
PyResolve handles the following Pydantic migrations automatically:
|
|
315
|
-
|
|
316
|
-
- `Config` class → `model_config = ConfigDict(...)`
|
|
317
|
-
- `@validator` → `@field_validator` with `@classmethod`
|
|
318
|
-
- `@root_validator` → `@model_validator`
|
|
319
|
-
- `.dict()` → `.model_dump()`
|
|
320
|
-
- `.json()` → `.model_dump_json()`
|
|
321
|
-
- `.schema()` → `.model_json_schema()`
|
|
322
|
-
- `.parse_obj()` → `.model_validate()`
|
|
323
|
-
- `orm_mode = True` → `from_attributes = True`
|
|
324
|
-
- `Field(regex=...)` → `Field(pattern=...)`
|
|
325
|
-
|
|
326
|
-
## Configuration
|
|
327
|
-
|
|
328
|
-
PyResolve can be configured via `pyproject.toml`:
|
|
329
|
-
|
|
330
|
-
```toml
|
|
331
|
-
[tool.pyresolve]
|
|
332
|
-
# Path patterns to exclude from scanning (defaults: .pyresolve/*, tests/*, .venv/*, venv/*)
|
|
333
|
-
exclude = ["tests/*", "migrations/*"]
|
|
334
|
-
|
|
335
|
-
# Enable/disable LLM fallback
|
|
336
|
-
use_llm = true
|
|
337
|
-
|
|
338
|
-
# Anthropic API key (can also use ANTHROPIC_API_KEY env var)
|
|
339
|
-
# anthropic_api_key = "sk-..."
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
## Pricing
|
|
343
|
-
|
|
344
|
-
PyResolve uses a tiered pricing model:
|
|
345
|
-
|
|
346
|
-
| Tier | Price | Features |
|
|
347
|
-
|------|-------|----------|
|
|
348
|
-
| **Free** | $0/month | Tier 1 deterministic transforms (15 libraries including Pydantic, Django, Flask, SQLAlchemy, and more) |
|
|
349
|
-
| **Pro** | $19/month | Tier 2 KB-guided LLM migrations for any library |
|
|
350
|
-
| **Unlimited** | $49/month | Tier 3 pure LLM migrations + priority support |
|
|
351
|
-
|
|
352
|
-
**How it works:**
|
|
353
|
-
- **Tier 1 (Free)**: Runs entirely locally using deterministic AST transforms. No account required.
|
|
354
|
-
- **Tier 2/3 (Paid)**: LLM-powered migrations are processed through the PyResolve API to ensure quality and manage costs.
|
|
355
|
-
|
|
356
|
-
```bash
|
|
357
|
-
# Login to access Pro/Unlimited features
|
|
358
|
-
pyresolve login
|
|
359
|
-
|
|
360
|
-
# Check your current plan and usage
|
|
361
|
-
pyresolve quota
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
## License
|
|
365
|
-
|
|
366
|
-
This software is licensed under the [MIT License](LICENSE).
|
|
367
|
-
|
|
368
|
-
You are free to use, modify, and distribute this software. The CLI tool and all transforms are fully open source.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|