Updated OpenGL rendering example to remove the distutils import#1205
Conversation
📝 WalkthroughWalkthroughReplaces distutils-based boolean parsing with argparse.BooleanOptionalAction for three CLI flags in the OpenGL example to restore compatibility with Python 3.12; behavior, defaults, and control flow remain unchanged. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a05beb5 to
621a9d6
Compare
Greptile OverviewGreptile SummaryReplaced deprecated Key Changes:
Impact:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CLI as Command Line Interface
participant ArgumentParser as argparse.ArgumentParser
participant BooleanOptionalAction
participant Example as Example Class
User->>CLI: python example_render_opengl.py [args]
CLI->>ArgumentParser: Parse arguments
Note over ArgumentParser: Old: type=lambda x: bool(distutils.util.strtobool(x))
Note over ArgumentParser: New: action=argparse.BooleanOptionalAction
ArgumentParser->>BooleanOptionalAction: Handle --show_plot / --no-show_plot
BooleanOptionalAction-->>ArgumentParser: Return boolean value
ArgumentParser->>BooleanOptionalAction: Handle --split_up_tiles / --no-split_up_tiles
BooleanOptionalAction-->>ArgumentParser: Return boolean value
ArgumentParser->>BooleanOptionalAction: Handle --use_imgui / --no-use_imgui
BooleanOptionalAction-->>ArgumentParser: Return boolean value
ArgumentParser-->>CLI: Parsed args object
CLI->>Example: Initialize with args (num_tiles, custom_tile_arrangement, use_imgui)
Example-->>CLI: Example instance
CLI->>Example: Run render loop
|
|
Thanks for the fix, can you squash the changes down to a single commit? |
…eplace the functionality with the BooleanOptionalAction. Signed-off-by: Umar Nawed <umar.nawed@gmail.com>
3ae7748 to
62919ef
Compare
|
@shi-eric Squashed the commits. |
Updated OpenGL rendering example to remove the distutils import and replace the functionality with the BooleanOptionalAction.
Closes #1204
Description
Before your PR is "Ready for review"
__init__.pyi,docs/api_reference/,docs/language_reference/)pre-commit run -aSummary by CodeRabbit