(argv: list[str] | None = None)
| 18 | |
| 19 | |
| 20 | def main(argv: list[str] | None = None) -> int: |
| 21 | parser = argparse.ArgumentParser( |
| 22 | description="Update library tools for RustPython", |
| 23 | ) |
| 24 | |
| 25 | subparsers = parser.add_subparsers(dest="command", required=True) |
| 26 | |
| 27 | subparsers.add_parser( |
| 28 | "quick", |
| 29 | help="Quick update: patch + auto-mark (recommended)", |
| 30 | add_help=False, |
| 31 | ) |
| 32 | subparsers.add_parser( |
| 33 | "migrate", |
| 34 | help="Migrate test file(s) from CPython, preserving RustPython markers", |
| 35 | add_help=False, |
| 36 | ) |
| 37 | subparsers.add_parser( |
| 38 | "patches", |
| 39 | help="Patch management (extract/apply patches between files)", |
| 40 | add_help=False, |
| 41 | ) |
| 42 | subparsers.add_parser( |
| 43 | "auto-mark", |
| 44 | help="Run tests and auto-mark failures with @expectedFailure", |
| 45 | add_help=False, |
| 46 | ) |
| 47 | subparsers.add_parser( |
| 48 | "copy-lib", |
| 49 | help="Copy library file/directory from CPython (delete existing first)", |
| 50 | add_help=False, |
| 51 | ) |
| 52 | subparsers.add_parser( |
| 53 | "deps", |
| 54 | help="Show dependency information for a module", |
| 55 | add_help=False, |
| 56 | ) |
| 57 | subparsers.add_parser( |
| 58 | "todo", |
| 59 | help="Show prioritized list of modules to update", |
| 60 | add_help=False, |
| 61 | ) |
| 62 | |
| 63 | args, remaining = parser.parse_known_args(argv) |
| 64 | |
| 65 | if args.command == "quick": |
| 66 | from update_lib.cmd_quick import main as quick_main |
| 67 | |
| 68 | return quick_main(remaining) |
| 69 | |
| 70 | if args.command == "copy-lib": |
| 71 | from update_lib.cmd_copy_lib import main as copy_lib_main |
| 72 | |
| 73 | return copy_lib_main(remaining) |
| 74 | |
| 75 | if args.command == "migrate": |
| 76 | from update_lib.cmd_migrate import main as migrate_main |
| 77 |
no test coverage detected