File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ # Upgrade Python Library from CPython
2+
3+ Upgrade a Python standard library module from CPython to RustPython.
4+
5+ ## Arguments
6+ - ` $ARGUMENTS ` : Library name to upgrade (e.g., ` inspect ` , ` asyncio ` , ` json ` )
7+
8+ ## Steps
9+
10+ 1 . ** Delete existing library in Lib/**
11+ - If ` Lib/$ARGUMENTS.py ` exists, delete it
12+ - If ` Lib/$ARGUMENTS/ ` directory exists, delete it
13+
14+ 2 . ** Copy from cpython/Lib/**
15+ - If ` cpython/Lib/$ARGUMENTS.py ` exists, copy it to ` Lib/$ARGUMENTS.py `
16+ - If ` cpython/Lib/$ARGUMENTS/ ` directory exists, copy it to ` Lib/$ARGUMENTS/ `
17+
18+ 3 . ** Upgrade tests**
19+ - Run: ` python lib_updater.py --quick-upgrade cpython/Lib/test/test_$ARGUMENTS `
20+ - This will update the test files with appropriate RustPython markers
21+
22+ ## Example Usage
23+ ```
24+ /upgrade-pylib inspect
25+ /upgrade-pylib json
26+ /upgrade-pylib asyncio
27+ ```
28+
29+ ## Notes
30+ - The cpython/ directory should contain the CPython source that we're syncing from
31+ - lib_updater.py handles adding ` # TODO: RUSTPYTHON ` markers and ` @unittest.expectedFailure ` decorators
32+ - After upgrading, you may need to run tests to verify: ` cargo run --release -- -m test test_$ARGUMENTS `
You can’t perform that action at this time.
0 commit comments