Commit 905259f
authored
Fix: use python3 in debugger server.sh (#1590)
### What does this PR do?
Type of change: Bug fix
`tools/debugger/server.sh` invokes `python -c "..."` inside
`check_modelopt_local` (and `pip install -e .[dev]` in the fallback
path). Containers that only ship `python3` (no `python` shim) cause the
check to fail with `python: command not found`, exit 127. The server
interprets this as "modelopt not editable-installed", runs `pip
install`, the second check fails the same way, and the server aborts
before it ever listens for commands.
Switches both the inline import check and the install fallback to
`python3` / `python3 -m pip`.
### Usage
```bash
bash tools/debugger/server.sh
# now starts cleanly on python3-only images
```
### Testing
Verified inside a container where `which python` returns nothing and
`python3` is `/usr/bin/python3` (Python 3.12). With the old script,
`server.sh` aborted at `check_modelopt_local`. With this fix, the check
passes against an existing editable install and the server proceeds to
wait for the client handshake.
### Before your PR is "*Ready for review*"
- Is this change backward compatible?: ✅ — `python3` is present on every
image that previously had `python`.
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: N/A
- Did you write any new necessary tests?: N/A — internal tooling shell
script.
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
N/A — internal debugger tooling, not user-facing.
- Did you get Claude approval on this PR?: N/A
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated debugger tooling to ensure consistent use of Python 3 for
package validation and installation processes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: Chenjie Luo <chenjiel@nvidia.com>1 parent 38c7843 commit 905259f
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
0 commit comments